Gavin,

I will second what Dave is saying below..

The mind set is not to continue to believe that procedural is the key to
everything, but to begin to understand that the patterns have and where
designed to introduce code separation in its many forms, for a stronger
purpose in life.

By taking code and placing them into Service layers, and DAO's and beans
etc you are then basically saying that I am separating the business logic
and database code. This promotes stronger code re-use above all else, and
encourages people to think harder about the needs of their objects,
especially when it comes to the likes of Database Objects.

You began to argue that the only need would be to have a tier layer that
could just be switched out at will, if the need arises and is sort of an
example that can be applied, as you have stated. By switching from say
reactor, or transfor over to hibernate does become a lot easier. But the
bigger picture is you are defining straight away that you are going to be
promoting code re-use.

For example you would design and implement a section of code, lets say a
forum to your application. You would tend to keep that
as tightly integrated to itself as possible. This would mean that you could
just pull this out and replace this at will, because you have defined an
API that allows you do so. Sure you would need to make some changes to
incorporate the new forum that you might like to replace it with, but that
would be minimal because you have kept that layer separate.

OO and patterns is no different in thinking than that, ColdFusion makes it
hard to think like this because it is procedural right from the word go. It
takes a stronger mind to see that the patterns have been introduced to
provide easier testing, debugging, and most importantly stronger code
re-use.

Something that 99% of people tend to not see.


-- 
Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/
Google+: http://plus.google.com/108193156965451149543



On Thu, Jan 5, 2012 at 10:29 AM, Dave <davidame...@gmail.com> wrote:

>
> As you have noted, non-OO code works too :) - The real benefit of OO
> code is that it makes the application more maintainable (cheaper to
> own/run), hopefully reducing bugs in the process. - Yes, it comes at
> the expense of having to write more code up front, but you get used to
> that and find techniques to make that easier.  - There are good code
> gen's out there for CF, or you can roll your own to suit your needs -
> the default builder one isn't great. You can also use techniques like
> Mark's onMissingMethod below to reduce typing.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to