On Feb 20, 2007, at 12:54 PM, Daniel Stenning wrote: > In order for example to do something like serialization of class > data ? > > On 20/2/07 18:05, "Guyren Howe" <[EMAIL PROTECTED]> wrote: > >> I would love to >> write an Object-Relational mapping library for REALbasic. But until >> we have first-class classes (ideally metaclasses), I just don't think >> I can make such a library easy enough to use. Partly also, I'm hoping >> we will get first-class classes before horribly long, so I'd rather >> wait until then and do a really great OR library.
I'm going to wrap each table with a class. For each class, I need to keep track of a bunch of things: - What the name of its table is; - What instances of it are in use already (if you already have an object in memory that represents a row, and you process that row again after a search, say, you want to return the existing object, not create a new one). Notice that I also need Weak References for this; - What relations have been declared between this class and others; and so on. I need somewhere to put all that information. It would also be helpful if, when I'm pulling information from a database selection, I have a simple dictionary I can go to, look up the table name, map that to an object, and ask it to give me the corresponding objects back. All of this screams "first class classes". Also, there will be many such classes, with a great deal of shared behavior between them. This screams "metaclasses". I have an application with an OR layer I've written that I'm using right now. Working around the lack of these features has involved a truly horrible amount of almost-identical, tedious to write, tedious to debug code. Now that I've gotten it working, writing the *rest* of the application is great. My UI and other code doesn't know that a database is even involved. But I wouldn't even want to try to document how to use the OR framework I have, let alone support or extend it. So I'm waiting for first-class classes and metaclasses, at which point I'll do a new version (I know how to do it much better now, having done it once), and I would implement a OR framework for REALbasic that will be almost as good as the one in, say, Ruby on Rails. I would also reimplement my Undo and Serialization frameworks (on my website) so they're much easier to use, and I'd like to see a high- level Remote Method Call framework for REALbasic, so I'd probably take a crack at that, too. The esoteric language features I've mentioned will not be of interest to 90% of REALbasic programmers -- EXCEPT that they will let me and others write really easy to use drop- in frameworks for beginners and experts alike. Regards, Guyren G Howe Relevant Logic LLC guyren-at-relevantlogic.com ~ http://relevantlogic.com REALbasic, PHP, Ruby/Rails, Python programming PostgreSQL, MySQL database design and consulting Technical writing and training _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
