Hi!

> You would use a more domain-oriented design approach.  Setters/getters
> are merely used because of all the frameworks that support (and
> expect) them.  Why do you care where the man is carrying his pencil?
> Perhaps he's keeping it in his sock. All you want to do is ask the man
> object for a pencil.

Yes.

> Having to go through his carrying bag to his
> pencil case to get his pencil is exposing the implementation.

I don't plan to expose implementation. I just want to make the
implementation inside the man. But more easily.

> However, if you have to ask him for the pencil and then he can go dig
> in his bag to get his pencil case to find a pencil, then perhaps he can do
> something at that point and jot down a note that you've just borrowed
> a pencil from him.

This is correct but I want to streamline the implementation of "he can go dig
in his bag to get his pencil case to find a pencil".

Again, the more complex you make the example ("jot down a note that
you've just borrowed from him") the more special and rare case you
make it. That's not what I am after to simplify. I want to simplify
the 90% of cases where it is ONLY about GET an item without
interventions.

It should be possible to say that "man will proxy by default all get
methods of his belongings", It should be possible to say that "bag
will proxy by default all get methods of his belongings". Same with
pencil casing. In such situation i wouldn't need to CODE all thsoe
get.get.get.get methods but the framework or compilation procedure
would provide them automatically.

WHEN I want to intervene the GET method (and track borrowed pencils
for example) I could just override the man.getPencil explicitly to do
that.

**
Martin


>

Reply via email to