Jonathan LaCour wrote:
>
> > Just two questions:
> > - is the inner "mapping" class absolutely needed?
>
> Absolutely needed? Not really. However, I really like it, for a few
> of reasons:
>
> * I think it makes it clearer that the attributes on the
> instance are
> a *result* of the properties in the mapping class, not the actual
> properties themselves.
>
> * It is good for namespacing things a bit. Less of a risk of
> collisions
> and the like with the scope of the class.
>
> * It still maintains a little bit of SQLAlchemy's philosophy of
> keeping
> the mapping separate from the class. I look at it as
> basically inlining
> the once separate mapping directly into the class definition.
>
> However, I am willing to listen to any arguments to remove the
> mapping class, or to rename it to something else. I also considered
> using the name "meta" and "schema".
Well regarding "meta" vs "schema" vs "mapping", keep mapping as is the
best IMHO.
As I said I don't know enough about SQLAlchemy to understand every
detail you talked about, anyway you may be interested to see (but you
already seen it probably) how we solved the same problem in TG for
declarative forms.
That's what you can do:
class CommentFields(WidgetsDeclaration):
name = TextField()
comment = TextArea()
comment_form = TableForm(fields=CommentFields())
This is probably not doable with SQLAlchemy tough, does it use
instances like TG for a Form?
Anyway I'm just trying to give you some inspiration since you asked for
comments. :D
>
> > - why not AlchemyMapper? DHH may accuse you of copying
> > ActiveRecord.
>
> Actually, the term "Active Record" describes a design pattern by the
> same name. Ruby on Rails' ActiveRecord library is simply
> implementing the "Active Record" pattern. Ideally, I would like the
> base class to be called ActiveRecord, however I think that a horde of
> uninformed rubyites would probably accuse me of copying Rails. So,
> thats why I picked ActiveMapper, which was actually a suggestion of
> Mike Bayer's. DHH knows the pattern, and so probably wouldn't accuse
> me of copying them, and if he does, I can mercilessly shoot him down :)
>
> I would be open to changing it to something else to avoid the issue
> altogether, but I don't like AlchemyMapper. In many ways, I am also
> attempting to implement the "Active Record" pattern, and I thought
> that ActiveMapper was both close enough to the pattern name, and far
> enough from the Rails' base class to cause confusion.
>
> Any other ideas?
Don't worry really, I was just just joking.
I knowed about the ActiveRecord pattern (read it somewhere on DDH blog
probably) but since you said you're also trying to implement it (and
that's great) it makes perfect sense the ActiveMapper name, it's nice
and also blessed by Mike. ;-)
>
> > Keep the great work.
>
> Will do!
Great.
Ciao
Michele
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---