It would make sense to always pass the alias, because if the alias is not
set in the config, you can just copy the value from name into the alias
field.

Make sense?

Michael 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Miller,
Ryan
Sent: Thursday, February 09, 2006 5:40 PM
To: [email protected]
Subject: RE: Reactor For CF ORM xml

Question for the list.

Assuming this format...

<object name="tableName" alias="className">
  <properties>
    <property name="colName" alias="propName" />
  </properties>
</object>

Should the various create functions of the reactorFactory object accept the
object name or the object alias?

<cfset reactor = CreateObject('component',
'reactor.ReactorFactory').init(expandPath('reactor.xml')) />

<cfset SomeGateway = reactor.createGateway("className") />

Or 

<cfset reactor = CreateObject('component',
'reactor.ReactorFactory').init(expandPath('reactor.xml')) />

<cfset SomeGateway = reactor.createGateway("tableName") />

I'm leaning toward passing the alias instead of the name.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael
Lantz
Sent: Thursday, February 09, 2006 12:03 PM
To: [email protected]
Subject: RE: Reactor For CF ORM xml

Yes, that is what I would envision, as well.

Michael 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Miller,
Ryan
Sent: Thursday, February 09, 2006 12:56 PM
To: [email protected]
Subject: RE: Reactor For CF ORM xml

Yes, this was my plan.  Leave out the properties node and Reactor does as it
does today.  

To make things more backwards compatible it should look like this.

<object name="tableName" alias="classname">
  <properties>
    <property name="colName" alias="propName" />
  </properties>
</object>

This way the name attribute always equals the table name (or db column
name) and the alias always equals the OO name.  This makes the alias
attribute of the property nodes optional too, without them your OO
properties match the db columns, but are restricted to the columns listed.  

I think that's much better.  Thanks Michael.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael
Lantz
Sent: Thursday, February 09, 2006 11:48 AM
To: [email protected]
Subject: RE: Reactor For CF ORM xml

I am a little concerned about the changes to the <object> tag.  While using
the attribute "table" isn't really a problem, I wouldn't want to HAVE to
specify it to make it work.  If I want the object name to be the same as the
table name, it should automatically create the table attribute with the text
from the name attribute.

This may have been the plan, but I wanted to specify it for clarity.
And, the same should go for the <property> tag name.

Michael

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Miller,
Ryan
Sent: Thursday, February 09, 2006 12:34 PM
To: [email protected]
Subject: RE: Reactor For CF ORM xml

I'm neutral, so if nobody else has any objections I'll change it.

<object name="SomeClass" table="SomeTable">
  <properties>
    <property name="someID" column="ID" />
    <property name="name" column="some_name" />
  </properties>
</object>

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe
Rinehart
Sent: Thursday, February 09, 2006 11:22 AM
To: [email protected]
Subject: Re: Reactor For CF ORM xml

I'd recommend changing "field" to "property", but that's just because my
natural inclination is to describe ORM as mapping object "properties" to
database "columns".

Cheers,

Joe

On 2/9/06, Miller, Ryan <[EMAIL PROTECTED]> wrote:
>
> It seems like a lot of people like this idea.  Lets agree on a config 
> xml format before any coding happens.  I'd be totally happy to take on

> the work of doing this.  If the end results are quality then maybe 
> Doug will adapt it.
>
> <object name="SomeClass" table="SomeTable">
>   <fields>
>     <field name="someID" column="ID" />
>     <field name="name" column="some_name" />
>   </fields>
> </object>
>
>
> There's probably more that could be added to the field node for 
> attributes, for example, what if you want to do some kind of type 
> conversion, but this seems like a good place to start.
>
>
>
>
>  ________________________________
>  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
> Tormod Boga
> Sent: Thursday, February 09, 2006 10:50 AM
> To: [email protected]
> Subject: RE: Reactor For CF Object Relational Mapping
>
>
> Hmm.. I thought I tried that, and couldn't make it work.. I'll get the

> latest from SVN and try it again tomorrow when I get back to work..
>
> At 11:43 09.02.2006 -0700, you wrote:
>
> Just so you are aware, you can use aliases when working with the 
> table/view name, just not the field names.
>
> This can be done in the config xml file by adding the
'alias="newtablename"'
> to the <object> tag.
>
> Michael
>
>  ________________________________
>  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
> Tormod Boga
> Sent: Thursday, February 09, 2006 11:36 AM
> To: [email protected]
> Subject: Re: Reactor For CF Object Relational Mapping
>
> I agree with both of you.. A thing like this would be great.
> I have previously requested the feature of adding aliases to the 
> table/object names, because I have to deal with tables named tblxxx
too..
> The code would look alot nicer if the generated objects had discarded 
> the 'tbl' prefix (by giving it an alias).
> Doing the same thing for columns would be great as well..
>
>
> At 12:29 09.02.2006 -0600, you wrote:
>
> I think this would be great as sometimes I have to use legacy named 
> tables with the 'tbl' prefix.  I also like to name my tables in 
> plural, "users", "orders", but I like to have my objects singular, 
> "user", "order".  I also like to name my columns in the db with an 
> underscore, but my methods are camelCase.  Of course, this probably 
> adds a level of complexity that Doug may not want to attempt.
>
>
> On 2/9/06, Miller, Ryan <[EMAIL PROTECTED]> wrote:
>
> To follow up my questions on Views and in relation to the other 
> discussion about only saving certain values.
>
> Is adding some mapping capability to the config xml been discussed or 
> planned?
>
> Or does this little community prefer doing it's mappings via Views?
>
> I'm thinking about diving into the code to add support for something 
> like this in the config xml
>
> <object name="SomeClass" table="SomeTable">
>   <fields>
>     <field name="someID" column="ID" />
>     <field name="name" column="some_name" />
>   </fields>
> </object>
>
> I thought I'd just float the idea here to see if this has been 
> discussed or tried already before jumping in with both feet.
>
> Thanks,
> Ryan Miller
>
>
> --
> Marlon
> / Tormod Boga
> / [EMAIL PROTECTED]
>
>
> __________ NOD32 1.1401 (20060209) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
> / Tormod Boga
> / [EMAIL PROTECTED]


--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com









Reply via email to