Defining definitions both ways won't work... ever ;o) More often than
not it will go into an infinite loop of doom ;)
>
> 2. For many-to-many, maybe the rule could be that if a table contains
> nothing but two foreign keys (possibly a primary key as well for those who
> create an independant primary key on every table) you'd use a many-to-many.
> In general, once a link table has any field other than foreign keys it's
> going to need it's own TO definition, and hence a pair of one-to-many's.
>
The new composite key spec makes this even more interesting ;o)
Mark
Mark
On 9/5/07, Brian Kotek <bria...@gmail.com> wrote:
Brian,
Sounds like a great addition. Just a couple of thoughts:
1. I like the idea of defining relationships both ways and then deleting the one you don't want. I'd be intrigued to see if you can actually run with a relationship defined in both directions. Have you tried this? I know there are some circumstances where Transfer will load the whole collection regardless of the "lazy" attribute - there was a thread about this a while back.
2. For many-to-many, maybe the rule could be that if a table contains nothing but two foreign keys (possibly a primary key as well for those who create an independant primary key on every table) you'd use a many-to-many. In general, once a link table has any field other than foreign keys it's going to need it's own TO definition, and hence a pair of one-to-many's.
You're going to get very corrupt data if you do this.
I agree.
> Another alternative would be to insert the relationship configuration, but
> have this commented out. That way, you would just uncomment the
> relationships you wanted to implement and could safely ignore the rest.
Yes, that sounds like a good approach.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
I just thought that I'd point out that Brian Rinaldi's cfc generator tool ( http://cfcgenerator.riaforge.org/) does this already, via the Transfer template, albeit without the relationships. I've been using it to generate the transfer xml for my projects and it does save a lot of time.
Bob
> > > > W: www.compoundtheory.com <http://www.compoundtheory.com>
> > > >
> > > > > >
> > > >
> > >
> >
> >
> > --
> > E: mark....@gmail.com
> > W: www.compoundtheory.com <http://www.compoundtheory.com>
> >
> >
> >
> >
>
>
> >
>
--
E: mark....@gmail.com
W: www.compoundtheory.com <http://www.compoundtheory.com>
Like Illudium, mine produces all the Coldspring files and Transfer
decorators and will soon produce a bunch of custom code too.
I'm interested in seeing your take on things.
Adrian
Doesn't it seem a little backward to be introspecting the DB to get
config files? What if there were a standard XML application definition
schema which also included the database definition. This file could be
used to describe not only the structure of the database, but also the
relationships between entities (similar to the Transfer). It could
also include data used by the application for business logic or
presentation of forms, etc. This information could be used to generate
config files for Transfer, ColdSpring, MG, etc. It could also be used
to generate the DB. Any change to the application definition schema
could trigger updates to the database and any generated code or config
files that were mapped and would include the ability to turn pieces on
and off. The huge upside would be that the application definition
schema would be framework agnostic and could also be used by
developers wanted to build custom frameworks. We could also begin to
develop widgets and components that read the defintion file and allow
developers to drop in some really cool opensource modules. Just
thinking out loud.
Has anyone else thought about this approach or started developing such
a beast? Does something already exist that I am not aware of?
Jonathan
Closest CF project would probably be CF on Rails which is available at
cfrails.riaforge.org which is being managed now by Sam Larbi although I'm
not clear how active the development is . . .
Best Wishes,
Peter
There are commercial tools that generate XML files based off of ERD diagrams. That is really the way to go. Creating an XML file with all of the information necessary to generate DB tables would be much more painful then generating the Transfer config files.
Zach
On 9/5/07, Peter Bell <pb...@systemsforge.com> wrote:
I think quite a few of us work that way, but I'm not sure whether there is
anything open source in the CF community. If you're looking for inspiration,
check out Django in the Python world or RiFE in the Java world.
Closest CF project would probably be CF on Rails which is available at
cfrails.riaforge.org <http://cfrails.riaforge.org> which is being managed now by Sam Larbi although I'm
I think a lot of CF apps are written to connect to existing database systems (at least a lot of the ones I write are). So being able to introspect or reverse engineer a transfer config file from an existing schema would be very useful. I’ve been using Illudium but it only does one table at a time and doesn’t do relationships.
Of course it would be very cool to have a OSS tool that reverse engineered a db to an ERD which could then forward generate xml config files from custom xsl stylesheets. I know there are tools like that but they tend to be pretty expensive.
Peter, Thanks for the input - I will check out the technologies you
mention to see how they do things. Your description of moving beyond
scaffolding is exactly what I am envisioning... at least at some
point. For now, I am just trying to make my life easier in terms of
managing all these config files and autogenerated code.
Zach, the XML would be used for much more than Transfer XML
generation. It could (theoretically) be used to generate the database,
controllers, MG config, Transfer config, ColdSpring config, form
definitions. There could also be a data management aspect similar to
DbUnit. So, if it was well thought out, you could (theoretically
again) remove the need to understand the various framework
configuration properties since the tool would generate the framework
xml config files for you. With the ability to extend components and
modify as needed.
I will make an attempt to create a basic proof of concept for
discussion.
This is basicly the way my scaffolding for Fusebox 5.5 will work. Its is
still in development expect Alpha by the end of this month. I have written a
bit about it in my Blog www.objectiveaction.com but I have been quite slow
getting it all going. I can send you the latest documentation but its a bit
behind the development at present.
What my code will do is introspect the database to create an initial XML
file which user can then modify.
Code of various sorts is then created from the XML file. Although my
templates will assume fusebox I intend to create some support for Reactor
(Nearly Finished), Transfer (Not started), ColdSpring (Just Started) and
Flex (Not started).
Kevin Roche
Team Fusebox