> Database, then another CFC to wrap the Query results in XML. Would that be a
> proper "MVC" approach? Couldn't you view the WrapInXML() CFC as a proper
> "controller" method?
If I needed multiple formats, I'd probably make a single CFC that has
three methods, one to pull the raw menu query (probably delegatin gto
a dedicated DAO), one to pull the menu as a structure, and one to pull
the menu as XML. That's really a single job, so it makes sense to
have it all in one CFC. then you controller can call whichever method
it wants, to get the data in the format it needs.
Your model provides data to the controller. Since XML is data (just a
different format), i don't think it really belongs in the controller.
THe controller's job is managing application flow, and is usually tied
tightly to the UI. I wouldn't recommend mixing the DB code and the
XML formatting code necessarily, but I'd say returning the data in XML
format is part of the model's job (though at the "top" end of the
functionality spectrum).
cheers,
barneyb
On Fri, 23 Jul 2004 12:40:19 -0400, Jeff Small <[EMAIL PROTECTED]> wrote:
> > Depends on what you're looking to do. Structs are probably going to
> > be slighly faster, and they'll be more familiar as well (since you use
> > them all the time). XML, on the other hand, will let you build the
> > navigation with XSL, which can be very advantageous in certiain
> > situations. In addition, you can use the XML document like a struct,
> > though there are extra levels of nastiness in there (like xmlChildren
> > and xmlAttributes).
>
> My approach in this situation would be to create a CFC that queries the
> Database, then another CFC to wrap the Query results in XML. Would that be a
> proper "MVC" approach? Couldn't you view the WrapInXML() CFC as a proper
> "controller" method?
>
> Just curious if I would be overthinking it, or approaching it in a nice,
> clean, "best practices" way. He's got one component that basically is his
> "model" component, and anything that would wrap his results for any kind of
> formatted output would be a "controller" component...is that right?
>
> So you could even do something like, WrapInXML(GetMenuItems())...couldn't
> you?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

