-TM
--
You received this message because you are subscribed to the Google Groups
"Object-Oriented Programming in ColdFusion" group.
To post to this group, send email to coldfu...@googlegroups.com.
To unsubscribe from this group, send email to
coldfusionoo...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/coldfusionoo?hl=en.
I'm loosely aware of what you are discussing and would like to throw in
my 2 cents, which may not help at all!
http://en.wikipedia.org/wiki/Hibernate_(Java)
<http://en.wikipedia.org/wiki/Hibernate_%28Java%29>
Hibernate for JAVA seems popular, so perhaps a good option is to do as
they do.
As long as you have thought about the pros and cons of each approach
then do which ever suits your project/style.
In particular, your object doesn't really know how to save itself, it
knows there is a related service and that service knows how to save
the object. So you're not breaking your intuition / feeling here...
In particular, your object doesn't really know how to save itself, it
knows there is a related service and that service knows how to save
the object. So you're not breaking your intuition / feeling here...
--
> Once you lay it out and live with it for a while, maybe even a year or more,
> you'll see if there are flaws in your design. The problems will become
> self-evident. It always happens, so just be ready for it. Sometimes it takes
> years to see how a system should have been designed. Always prepare to make
> time for refactoring on this level.
That is an excellent point, Nathan. Sometimes we spend too much time
trying to figure out the best design, only to discover down the road
that there were issues with the design we chose. If your design
follows the proper design principles, it should be no problem to
refactor it in the future when you discover a better design. Bringing
that back to this discussion, as pretty much everyone has said, as
long as your object doesn't know how it's being saved (i.e., all of
that logic is encapsulated in another object) then you'll be able to
refactor in the future, so just choose whatever feels right to you at
the moment.
Cheers,
Bob
--
Bob Silverberg
www.silverwareconsulting.com