Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Best OOP strategy?

by djantzen (Priest)
on Aug 16, 2002 at 04:33 UTC ( [id://190592]=note: print w/replies, xml ) Need Help??


in reply to Best OOP strategy?

"Perfect" object-oriented architectures are as elusive as Plato's forms, and even more so when sought beginning from a script. For example, using our to declare your objects within MyScript::new not only makes those globally accessable, thereby violating encapsulation, but it in no way ties those instances to the instance of MyScript, rather to the package. So far you've got a script that merely utilizes packages and functions, not objects.

If you want to make this a thoroughly OO system I suggest reflecting on this as a data structure issue. What groupings of information naturally fit together? What information ought to be unique to a particular instance of the package, and what may be appropriately tied to the package statically? If done well the program control flow will follow naturally from the object model, rather than a preconceived notion of control determining how you model your data.

I also recommend perusing the tutorials section on OOP.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://190592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (9)
As of 2024-03-28 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found