Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://899762]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2018-06-21 01:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.