> --
> You received this message because you are subscribed to the Google Groups
> "Object-Oriented Programming in ColdFusion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/coldfusionoo/-/MmdxZE9Z7BoJ.
> 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.
>
Ugh! NOT EVERYTHING IS AN OBJECT!
Sorry for shouting. CFML is not Java.
Java forces EVERYTHING to be an object. That is a dumb idea. Java is a
BAD language. There are much better languages on the JVM.
It is just FINE for things to be procedural when it makes sense.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/
"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)
--
You received this message because you are subscribed to the Google Groups "Object-Oriented Programming in ColdFusion" group.
On Thu, Jun 23, 2011 at 1:23 AM, James Buckingham <clar...@gmail.com> wrote:
> And with respect I've spent 6+ mths trying to get our team out the habit of
> writing procedural "spaghetti" code and teach them how to make nice
> reusable, if you want to call it OO-style, approaches to solving problems.
procedural != "spaghetti" code. There can be good, reusable
procedural code just like there can be bad OO spaghetti code.
> Telling them that now we're 90% through this to go back to procedural
> coding, because Sean C. says all this stuff is now dumb, just isn't going to
> happen.
"NOT EVERYTHING IS AN OBJECT" != "all this stuff is dumb"
You're kind of twisting words, when you've already pretty much agreed
to doing exactly what Sean (and everybody before him) is saying...
putting a bunch of SQL queries in a Reporting Service cfc, which isn't
particularly OO. That doesn't make it "bad". You've still got a well
architected application with a clear separation of concerns. It
doesn't automatically mean that the rest of your OO code will turn
into procedural spaghetti, nor does it mean that the rest of the OO
architected code in your app is dumb.
You say you're asking how people approach this problem in an OO
style... and the answer that you've gotten (which again, you seem to
have agreed with), is that they don't. Sean's answer was more or less
the same, except, y'know, with shouting :D
Just sayin'... keep things in perspective :)
--
Charlie Griefer
http://charlie.griefer.com/
I have failed as much as I have succeeded. But I love my life. I love
my wife. And I wish you my kind of success.
Yes, and me telling you reporting SQL doesn't belong in objects is a
reasonable answer.
> I'm really asking how people approach this problem in an OO style ...
> language aside ( not that I mention anything about Java ).
And I'm saying don't try to shoehorn this sort of stuff into OO.
The whole point of OO is modeling "state + behavior" together. If you
have a pure "service", it's not OO by definition so don't fool
yourself. This is at the root of most of the problems CFers get into
with OO: they try to make _everything_ into an object (and it's partly
Java's fault which requires everything live in a class).
> And with respect I've spent 6+ mths trying to get our team out the habit of
> writing procedural "spaghetti" code and teach them how to make nice
> reusable, if you want to call it OO-style, approaches to solving problems.
And with respect I've been doing OO for 19 years and some of that
experience is when OO is not the right solution :)
I'll say it as plainly as I can:
- OO is not equivalent to well structured maintainable code.
- Procedural is not equivalent to poorly structured unmaintainable spaghetti.
Use OO where it makes sense but don't use it where it doesn't make sense.
--
regards,
larry
> --
> You received this message because you are subscribed to the Google Groups
> "Object-Oriented Programming in ColdFusion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/coldfusionoo/-/L-QYqZa87bIJ.
> 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.
>
--
Larry C. Lyons
web: http://www.lyonsmorris.com/lyons
LinkedIn: http://www.linkedin.com/in/larryclyons
"I do not feel obliged to believe that the same God who has endowed us
with sense, reason, and intellect has intended us to forgo their use."
Galileo
On Thu, Jun 23, 2011 at 2:53 PM, James Buckingham <clar...@gmail.com> wrote:
> I will :-).
> Thanks Larry
>
> --
> You received this message because you are subscribed to the Google Groups
> "Object-Oriented Programming in ColdFusion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/coldfusionoo/-/vifjbW87BesJ.
Procedural simply means a set of steps. Perhaps saying structured
programming would conjure up the right mental model instead? :)
In the CFML world, we have a bit of a history of using the wrong
terminology - or at least creating new meanings for terminology that
has well-defined meaning in other communities... Just something we
need to be diligent about.
Reporting is, pretty much by definition, large slabs of (procedural)
code based around often complex SQL queries. You don't gain much from
putting this code in a CFC as methods, except perhaps from an
organizational point of view (perhaps some private helper methods).
There's minimal benefit in creating an instance of such CFCs since
there's no state and (probably) no configuration. The overhead of
creating an instance of such CFCs is minimal and you're not likely to
be creating such instances often enough for it to matter (once per
user request, most likely).
In other words, exercise caution when using CFCs for reporting
services so that your developers don't try to treat them like objects
- perhaps always use them via cfinvoke and a component path name so
you guarantee getting a new instance and folks don't try to keep
instances around. You might even consider using custom tags instead,
to emphasize the distinct nature of these beasts (seriously - you need
a strong way to flag these are not "objects" in any traditional
sense).
I think the reason we lean toward CFCs as our unit of organization is
because of our Java influence. Before Java, structured code
organization was possible (and, in fact, widespread) using a variety
of means, including directory or module structuring - and no one was
under any misconception that these blocks of code were somehow
"entities" in the application model.
In some ways, Java has clouded our thinking around structured programming...
Hope that clarifies why I'm pushing back on this issue so strongly?
--
You received this message because you are subscribed to the Google Groups "Object-Oriented Programming in ColdFusion" group.