"It's very relevant to the "outside" world"

I respectfully disagree. You think the interface layer should know about
persistence?


"if you handed me a "user object", ... I would not expect it to be able to
create, delete, or persist *other* user objects"

"Your "UserService" would have
methods like createUser():User, saveUser(User):void and
fetchUserById(id):User, as well as methods like getAllUsers():query"

So your issue is that doesnt have "service" in the name?


"Having a user object that both models a user AND performs
service-style methods is an example of a monolithic object"

It doesnt, its a facade, it passes the operation on to the appropriate
layer.
It certainly doesnt have any SQL in it if thats what you mean.


"quickly becomes difficult to maintain"

Well, I have interface layer code a bit like this (and you're really not
gonna like it!):

<!--- lets say url.obj = "user" --->
obj = application.factory.new(url.object);
result = obj.processinput(data=form,action=form.action);
writeoutput(result.message);
writeoutput(obj.generateform());

It handles all the form entry, create, update, delete for every object in an
entire app.
The interface layer only knows that: the factory makes objects, objects
generate and accept forms.
I have found it very maintainable, and large applications can be written in
a day.

So you would have:

UserGateway
UserService
User(Model)

And the interface layer needs to create, call, and pass these all into each
other as needed?
Is that what you are saying?
If so, then it seems to me thats pretty intimate knowledge about the
structure of your app, and you had better not ever change that or it will
become difficult to maintain!






----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to