Re: [MOP] How do I add an extra slot to a class?
- From: Madhu <enometh@xxxxxxxx>
- Date: Thu, 30 Aug 2007 08:22:54 +0530
* Saurabh Nanda <fb4f7j$is$1@xxxxxxxxxxxxxxxxxxxxxxxxx> :
|> Any reason why re-evaluating the defclass form (edited to include the
|> new slot definition) won't work for you?
|
| I'm writing a "defassociation" macro for CLSQL to make defining class
| associations more easier. So, after defining various view-classes
| (classes mapped to a tables) one can use the defassociation macro to
| define associations (has-one, has-many, has-and-belongs-to-many)
| between them. This macro will have to add new slots to hold the
| associated/joined objects in the classes participating in the
| association.
|
| This is why I can't re-evaluate the defclass form (or def-view-class
| form to be more specific) to include the new slot definitions.
That would explain it :) I found the CL-SQL view-class abstraction has
limitations, (as you may have also found), I tried unsuccessfully to use
it for a database-table-designer application. I ended up modelling the
database relationships and tables in my own CLOS objects, and then had
methods for generating the def-view-class form. (I haven't finished this
to my satisfaction -- still separatating a table class from a sub-class
with the join slots)
Another thing I wanted to do was: given a view-class object, introspect
the join slots and figure out the relations. The key thing is to have a
representation for the relations that your program (not just CL-SQL) can
access and use at runtime. This could not be done with view-class
across sql + lisp implementation combinations. (I use clsql and ysql,
and would like to use commonsql too). Also I couldn't mixin objects of
other other types with any ease which would make sense.
I'd be interested in knowing how end up solving this, or if I'm
incorrect in any of my assessments above
--
Madhu
.
- Follow-Ups:
- Re: [MOP] How do I add an extra slot to a class?
- From: Saurabh Nanda
- Re: [MOP] How do I add an extra slot to a class?
- References:
- [MOP] How do I add an extra slot to a class?
- From: Saurabh Nanda
- Re: [MOP] How do I add an extra slot to a class?
- From: Saurabh Nanda
- [MOP] How do I add an extra slot to a class?
- Prev by Date: Re: "You're an Idiot" flash
- Next by Date: Re: C++ Implementation of Lisp
- Previous by thread: Re: [MOP] How do I add an extra slot to a class?
- Next by thread: Re: [MOP] How do I add an extra slot to a class?
- Index(es):