Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Psychic Disconnect and Object Systems

by sundialsvc4 (Abbot)
on Apr 16, 2011 at 22:06 UTC ( #899762=note: print w/ replies, xml ) Need Help??


in reply to Psychic Disconnect and Object Systems

Even if it did get a bit carried away there towards the end, what BrowserUK said here is, in my opinion, excellent wisdom, well thought-out and presented.   I agree with that entire point of view.   It has some pretty subtle points in there, but it’s very clearly the voice of experience.

In my own experience, an object (in a programming system, albeit not so much in the real world) is, like everything else in a programming system, most of all a functional thing.   Which means, “methods.”   And, the tighter and the more self-contained it is, so much the better.

When you expose attributes, you run the calculated risk that there will in the future be other code out there somewhere, unrelated to this object but now functionally dependent on this object by virtue of the fact that it examines those attributes and contains “procedural code” of some kind that depends upon their values.   It is a procedural dependency, hidden, as it were, by a data dependency, caused, as it were, by a data exposure.   It can be problematic at times.   To put it another way ... it is a characteristic that might easily be overlooked with regard to its possible negative implications.

Everything in a programming system ought to have a specific purpose, and you ought to know, insofar as is possible and practical, what that purpose is to be ... before you build it ... and “built for and because-of that purpose.”   That statement is an ideal, of course, and therefore not always achievable and not always even desirable.


Comment on Re: Psychic Disconnect and Object Systems

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2014-10-30 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls