Object Oriented Overkill ?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Object Oriented Overkill ?

    Hello all, I'm curious about my current development methods with CFMX 6+ and
    your opinions. I wonder if it is possible to go too far with "objectifying"
    things in Coldfusion. Take this simple example.

    An application keeps track of current events in a database. I create a
    component / class that represents an Event with all its methods like getTime(),
    getDate(), and getDescription(). Now I create another component / class, an
    EventSchedule. Whenever I need to get a list of all Events, I would create an
    EventSchedule object and execute its method getAllClasses(). Now, the
    EventSchedule method, getAllClasses(), returns an array of Event objects.
    These objects were "filled" with their data using a query, looping through the
    query and adding all the Event data. Now the page that needs a list of all
    Events would create an EventSchedule object, call the method getAllEvents(),
    and then the page would receive an array of Event objects for use. Thus being
    able to loop through the array and calling the appropriate methods of each
    object.

    Is this overkill in object oriented design for ColdFusion? From a performance
    / execution standpoint? Anything I should consider or be worried about with
    this methodology shown above? I know performance-wise, the server seems to be
    taking somewhat of a hit when dealing with a bunch of objects, however the fact
    that all data is encapsulated inside of an object is something that is very
    desirable... no?

    Thanks for your thoughts and discussion.
    Britt Mileshosky

    sonoflight Guest

  2. Similar Questions and Discussions

    1. 3D object oriented lingo
      When building a large, possibly templates based project, what would be a better approach? 1. parent-child scripts? 2. lots of behaviuors? In...
    2. Object Oriented Web Design
      Hi all, I am looking at using Jscript classes and COM objects written in Java to implement OOD on the web. I was wondering if anyone knows of any...
    3. Complex Object Oriented Application
      Hi I'm an experienced programmmer in C++ and Java but I'm a beginner in ActionScript I'm wondering about the posibilities of AscionScript as an...
    4. packages object oriented
      Does anyone have a good hold of how to do object oriented programming in perl? Maybe a few lines of code as examples? EDUB
    5. oriented object programming
      Greetings I have the following class: #!/usr/bin/perl package monParser; use HTML::Parser; @ISA = qw(HTML::Parser);
  3. #2

    Default Re: Object Oriented Overkill ?

    sonoflight wrote:
    > Hello all, I'm curious about my current development methods with CFMX 6+ and
    > your opinions. I wonder if it is possible to go too far with "objectifying"
    > things in Coldfusion. Take this simple example.
    It's always possible to have too much of a good thing. ;-)
    > An application keeps track of current events in a database. I create a
    > component / class that represents an Event with all its methods like getTime(),
    > getDate(), and getDescription(). Now I create another component / class, an
    > EventSchedule. Whenever I need to get a list of all Events, I would create an
    > EventSchedule object and execute its method getAllClasses(). Now, the
    > EventSchedule method, getAllClasses(), returns an array of Event objects.
    > These objects were "filled" with their data using a query, looping through the
    > query and adding all the Event data. Now the page that needs a list of all
    > Events would create an EventSchedule object, call the method getAllEvents(),
    > and then the page would receive an array of Event objects for use. Thus being
    > able to loop through the array and calling the appropriate methods of each
    > object.
    >
    > Is this overkill in object oriented design for ColdFusion?
    Short answer, yes. From what you describe it sounds like you'd be WAY
    better off using a simple query object for this sort of functionality.
    Unless you actually need that array of objects for some reason that's a
    ton of unnecessary overhead when a query object would suffice.
    > From a performance
    > / execution standpoint? Anything I should consider or be worried about with
    > this methodology shown above? I know performance-wise, the server seems to be
    > taking somewhat of a hit when dealing with a bunch of objects, however the fact
    > that all data is encapsulated inside of an object is something that is very
    > desirable... no?
    Yes, definitely desirable but likely not necessary in that particular
    situation. When you're dealing with *individual* objects all the
    benefits of OO really kick in, but don't shy away from using a query
    object when that's what the situation calls for.

    Matt
    mpwoodward *TMM* Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139