4 ms·
Ah. In that case, it depends on the situation. If you're going to do something that depends on a property of an object, you're going to have to pass the prope
by pg 18y ago
Ah. In that case, it depends on the situation. If you're going to do something that depends on a property of an object, you're going to have to pass the property itself as an argument eventually. E.g. if you want to see if the ssn is a valid one, or equal to some other ssn.
I wonder if he's talking about some problem that happens with people who've converted from other languages, and that's why I don't understand it.
- raganwald 18y agoI agree, there's obviously a trade-off involved. I think the real issue is trying to identify RW-B's "Roles, responsibilities and Collaborations" in a design. There's (a) a piece of knowledge that a customer is involved, (b) a piece of knowledge that an SSN is involved, and (c) a piece of knowledge that an SSN can be extracted from a customer. I suspect the issue here is making good decisions about which entities/modules/functions/objects/thingummies should know a, which should know b, and which should know c.
- senorprogrammer 18y agoOddly I didn't expect the "property/object" one to be the most contentious! Who knew? Perhaps that one suffers more from brevity than all the others. The observation stems from seeing reams of web app code that take in form data (or raw database data) and then proceed to move it around the app without encapsulating it in any way. The result is functions like: function display_user( user_first_name, user_last_name...user_valid) Look at twenty or thirty functions like that in an app and one starts to think "perhaps you need a user object?" I certainly didn't mean to suggest we should all start tightly coupling all our classes together willy-nilly.
- raganwald 18y agoIt suffers from resembling a bikeshed ;-)