-------- Original Message --------
Subject: [coldbox:17842] [Coldbox 3.5.3] - Wirebox Question about OO
models and how they get populated.
From: Keo_74 <
kenneth....@gmail.com>
Date: Mon, March 18, 2013 11:08 am
To:
col...@googlegroups.com
Hello, I am new to Coldbox but have been programming Coldfusion 7+ years. I am new to using MVC in the coldfusion world, so some of what i'm looking for may not be coldbox specific.
I have been going through the online documentation and the videos, but honestly have grown somewhat frustrated because of how every document seems to be for a different version of coldbox.
I have looked at the sample apps but they too seem out of date.
So enough of my I'm a frustrated newbie disclaimer.
My company is looking at using coldbox in their next project. What I am trying to reconcile in my brain right now is how complex models would work in the Coldbox MVC world.
I do not want to use ORM at this time.
In the presentations videos I've watched it has been said that Coldbox Wirebox DI replaces the whole object factory pattern. But it seems to me that most of what the object factory was doing is just moved to a service object. So I'm not sure if I'm missing something.
Take the following models for example.
- Model : User
- First name
- Last Name
- User Name
- User ID
- Address
- Model :Address
- Address_1
- Address_2
- City
- State
- Country
- Zip
- Model : GalaticAddress
- Extends Address
- Solar System
- Sector
- Planet
So in the Object Factory world I would have something like an object called UserFactory. Which would have a method getUser (ID). The factory would connect to an UserDAO object, pull back the data, create a new user object, insert the data from the UserDao, Then the Factory would use AddressDAO and pull back the address and based on the type create either a Address or Galactic address and insert the resulting address object into the User object which is returned.
How would I do this in the ColdBox MVC world. I understand that I can have an user model that has a address model injected vi wirebox DI but I don't see how wirebox could choose which type of address object to use and I'm not sure where the responsibility for populating that address object lies.
I've seen the UserService objects created in samples. Would I also have an Address Service object?
Would the UserService object have to know all about the the address service?
I dont' see the difference between an userservice object and an UserFactory object.
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit
http://blog.coldbox.org For Documentation, visit
http://wiki.coldbox.org For Bug Reports, visit
https://ortussolutions.atlassian.net/browse/COLDBOX ---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
coldbox+u...@googlegroups.com.
To post to this group, send email to
col...@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.