Re: [Pyobjc-dev] SQLite and PyObjC
Brought to you by:
ronaldoussoren
|
From: Barry W. <bar...@gm...> - 2008-07-05 21:26:56
|
On Sat, Jul 5, 2008 at 9:17 AM, John Velman <ve...@co...> wrote: > Barry, > > Thanks for your response. Of course, XCode is an IDE, I knew that, but in > my haste (in the words of H. Clinton) "I said something I knew not to be > true". I think I should have said something like "the Cocoa Core Data > access to SQLite", which I have seen references to, and which, I presume, > is an Objective C interface to SQLite. No worries. Sorry if my answer came off as pedantic. CoreData is an object graph management framework that _happens_ to use SQLite as one of its backing stores. Apple has been very explicit in stating that you shouldn't rely on the SQLite schema it uses for your own purposes; it's an implementation detail and may change. As such, CoreData isn't really appropriate for reading from arbitrary SQLite databases or as a a way to write data to SQLite databases in a format that you control. It is a really strong object graph management system and is worth the time to grok it--just maybe not for this project. > > Anyhow, I am writing in PyObjC, so as you suggest, I'll use the python > interface. Have done C and C++ programming in the past, and suppose I > could learn objective C, but don't want to. I'm too old (my first > programming language was Fortran II, followed by the assembly language FAP > on an IBM 7090). Given your experience, I would expect that you could pick up Objective-C in less than a day. It's _much_ easier than C++ to grok (being a much simpler language). If you've come across smalltalk at all, you'll see many similarities. Depending on the scope of the project, you may find that the greater support provided by Xcode (including gdb and code completion of user defined types) for Objective-C vs. python outweighs the small cost of learning Objective-C. Regardless, I would stick to one or the other, if you can -- debugging across the language boundaries is not well supported by the available tools. > > Thanks also for your advice on NSTableView. You bet. Feel free to ping me offline if you need any pointers. > > Best, > > John V. > > On Sat, Jul 05, 2008 at 08:55:49AM -0700, Barry Wark wrote: >> On Fri, Jul 4, 2008 at 10:16 AM, John Velman <ve...@co...> wrote: >> > I'm hoping to write a Cocoa application with PyObjC that uses an sqlite >> > database. I will want browse views that show (multilple row) results >> > of a query, as well as forms for data entry or editing, and output of >> > reports in pdf format. I need to develop on Leopard intel, and run on >> > Tiger PPC. (I've looked at a couple of other approaches, but they each >> > have problems, and I aesthetically like the idea of PyObjC with Cocoa. >> > Thanks to the PyObjC developers!) >> > >> > I'm probably in way over my head. But here are a couple of initial >> > questions: >> > >> > 1. Which is better to use for the sqlite interface, the Xcode >> > interface to sqlite, or the Python interface? If Xcode is better, how >> > the heck can I find some documentation? Googling or searching in the >> > developer documentation hasn't gotten me there yet. Probably because I >> > don't know the right search words. The amount of Apple documentation is >> > enormous. >> > >> > Also, some documentation that won't be too hard to translate to use >> > with PyObjC? >> >> When you say Xcode, I assume you mean writing the interface in C or >> Objective-C. Xcode is an IDE, not a programming language or libaray, and >> in fact supports development in several languages including Python. There >> are C and Objective-C interfaces to SQLite, but if you intend to write >> the rest of your application in Python, I would recommend sticking with >> Python for the entire codebase. >> >> > >> > 2. For display of tabular query results, is NSTableView the "best" way >> > to go? >> >> Yes. >> >> I've had a quick scan of the "Understanding the NSTableView Class, >> > and a look at one of the examples, and I'm overwhelmed. I don't need >> > to edit this in place. One alternative would appear to be formatting >> > into columns in Python, and use some form of NSBrowser or NSTextView. >> >> Have a look at the NSTableDataSource Protocol Reference. NSTableViews >> keep a reference to a table data source. The data source supplies the >> approrpirate table data when requested. NSTableViews can also be >> populated via an NSArrayController using Cocoa's bindings technology. >> Given your lack of familiarity with Cocoa technologies, I would recommend >> the first (NSTableDataSource) approach. >> >> > >> > I think I can handle input and edit forms. If I can convince myself >> > that I can handle using sqlite in the Model, and some form of browser >> > as a view, I'll press on! >> > >> > Thanks, >> > >> > John Velman >> > >> > ------------------------------------------------------------------------- >> > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> > Studies have shown that voting for your favorite open source project, >> > along with a healthy diet, reduces your potential for chronic lameness >> > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> > _______________________________________________ Pyobjc-dev mailing list >> > Pyo...@li... >> > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev >> > > |