in reply to Object functionality?

Remember that OO programming is largely about modeling your data. Start with the data. Draw a diagram in UML or an old-school database ERD so that you can see the distinct pieces and how they fit together. Then add the functionality on top of that.

The best thing to do to improve these skills is to get a job working with some people who are good at OO modeling and pay attention. Failing that, books can help. Get the beginner books; don't try to jump into some crazy design patterns book right off the bat.

Replies are listed 'Best First'.
Re: Re: Object functionality?
by with.a.twist (Novice) on May 10, 2002 at 20:38 UTC
    It is also a good idea to keep in mind supportability and reusability when creating objects. Unfortunately, this -- "$x=new obj; $x->start;$x->finish;" -- is not very supportable. Try breaking things up with data in mind, but also breaking up objects in "the obvious way". It doesn't matter what methodology you use, but if you come back to the application 6 months later and have no clue what the objects do, you are stuck "re-creating" the wheel to maintain the code.

    As far as reusability, you have no chance in reusing an object (on another application, inside the same application, etc...) if your object is cram packed with functionality. Too many resources.