Gaetan de Menten wrote:

> Now, do we want to support both syntax? It wouldn't be hard to do
> I think. The problem is with the documentation and how we present
> things. That might bring some confusion to have yet another syntax.
>
> On the other hand, I'd find it really a shame if somebody (you or
> anybody else) started another declarative layer just because of the
> syntax, while most (95% at least) of the codebase could be common. So
> honestly, I don't know what to do. I'd be okay to (at least try to)
> make the code work both ways, and leave the OO way mostly undocumented
> (it would only be an alternative to the "official" syntax) but
> Jonathan might not agree with me on this since he likes the DSL thing
> a lot (it was his idea after all).

Okay, I have had lots of discussions on this over the past few months,
and its becoming more and more clear that the majority of people prefer
the more traditional approach when it comes to defining fields.  So,
with that said, I think we need to listen to our users here, and start
supporting the traditional syntax, but only for defining fields.  I
think the relation style needs to remain as a DSL-like approach.

That being said, I think its time that we went ahead and deprecated
`with_fields` in favor of the "OO" approach, since the syntaxes will end
up being quite similar, with the added bonus of preserving field order:

     class Person(Entity):
         id = Field(Integer, primary_key=True)
         name = Field(String)

         has_many('pets', of_kind='Pet', inverse='owner')

In the long-term, we might want to deprecate `has_field` as well, so
that we will have only one way to do things.  I am hesitant to do this
right now, but I haven't been happy having two ways to do the same thing
for some time now, and I think we need to resolve this at some point.

So, the long and short of it is that I will finally break down, so I
don't have to hear about it anymore ;) So, whoever wants this, please go
ahead and work on a patch, and we'll try to get it into the 0.4 release
so that people can use it sooner rather than later.  I want this to be
the last major API breakage before we release 0.4, and hopefully for a
long time to come.  The patch should contain tests and documentation
updates before we'll accept it.

Gaetan, Daniel, how do you guys feel about this?

--
Jonathan LaCour
http://cleverdevil.org


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to