Greetings:
I'm trying to implement Gateway and Factory objects which will, when
combined, manage my Business Objects. UserFactory will, naturally, create
for me a User object; UserGateway will handle the database integration
aspects for any and all User objects.
Should the UserFactory object utilize a (the?) UserGateway object when
creating for me a User object at, say, login or edit time?
pseudo:
class UserFactory {
function new() {
return CreateObject("user");
}
function new(UserGateway, userID) {
return CreateObject("user").init(UserGateway.retrieve(userID));
}
}
...or should I leave retrieval of a specific user record entirely to the
UserGateway?
more pseudo:
class UserGateway {
function select() {
return (queryObject);
}
function retrieve(userID) {
q = select from users where user_id = userID
return CreateObject("user").init(q);
}
functino update(user) {
try {
q = update users set ...
} catch {
return false;
}
return true;
}
...
}
How do you relate Gateways, Factories, and Business Objects to each other?
Thanks for your help and/or advice.
ecd.
--
Eric C. Davis
Programmer/Analyst I
Georgia Department of Transportation
Office of I.T. Applications
Web Applications Group
404.463.2860.199
[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]