On Sunday, November 7, 2004, at 11:37:49 PM, John Carter wrote:

> Years ago, before the name Naked Object was even coined, I constructed a
> naked object interface.

> It failed.

> Dismally.

> I mean, I personally used it to tweak things, but my users uniformly
> hated it.

> Today I stumbled across the notion again at
>    http://www.nakedobjects.org

There's a rather interesting book out from these folks. It's an interesting
idea, but I haven't tried it. My gut reaction is that "if you get the
objects right" it will probably work fine. Part of that is what you're
saying here ...

> and the thought collided in my mind with a quote from Bjarne
> Stroustrup:
>    http://www.artima.com/intv/goldilocks3.html
> "My rule of thumb is that you should have a real class
>   with an interface and a hidden representation if and only if you can
>   consider an invariant for the class."

> So my first Thought for the Day on Naked Objects....
>     "Objects should never be so Naked as
>      to be able to corrupt the invariant." 
> ie. Not all methods and setters should be visible, only those
> invariant preserving public accessors.

Yes ... I'm not sure offhand what the N.O. folks say, but I'd think that
you'd only want to expose the public interface ...

> Thought 2...

> That Naked Object system I did all those many years ago exposed the
> internal representation of the object. In that case it was water level
> in a cell measured in meters. The users cared not a fig for water
> level. They thought in terms of volume (m^3), an a very complex routine
> mapped between the two.

> So my second Thought for the Day on Naked Objects....
>    If the internal representation differs painfully from the users
>    external view on it, the Naked Object should by default dress itself
>    up a little to present the  users view.

> ie. Naked Objects Bad. Flimsily dressed objects with mostly see-through
> clothing and the occasional corset - Good.

Oh baby, oh baby! Ahem. Uh ... Yes, well.

It might even be that when an object's internal representation differs
painfully from the users' external view on it, we should treat that as a
code smell. Oh, there could be exceptions, where the objects use some cool
transform to give the user a nifty interface. But that might translate in
N.O. to there being two objects that one could talk to, and only one of
them really has the interface one wants, so we talk to that one.


I haven't dug into the book as deeply as I probably should. I've met one or
both the authors, at OOPSLA IIRC, and they seemed very smart in a British
sort of way. I'd like to play with a Naked Objects system a bit and see how
it feels.

Ron Jeffries
www.XProgramming.com
Logic is overrated as a system of thought.




To Post a message, send it to:   [EMAIL PROTECTED]

To Unsubscribe, send a blank message to: [EMAIL PROTECTED]

ad-free courtesy of objectmentor.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/extremeprogramming/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to