The Artima Developer Community
Sponsored Link

Heron-Centric: Ruminations of a Language Designer
The Backside of an Interface
by Christopher Diggins
February 9, 2006
Summary
A colleague of mine, Peter Grogono, brought to my attention recently the overlooked backside of interfaces.

Advertisement

The following quote was from a talk given by Peter Grogono, and surprised me something solid. Because I thought there wasn't anything I was fundamentally overlooking about software engineering :

Interfaces and “calling out the back” Another thing that all software engineers — and many other kinds of engineers — seem to agree about is the separation of interface and implementation. Of course, that’s closely related to encapsulation. I hope we all agee that the data members of an object should be private. So the interface of the object is defined by the methods it provides. Right? Well, up to a point.

Electrical engineers work with boxes. What comes out of the box is the interface. What’s inside the box is the implementation. Here’s a box. Is this its interface?

No, not quite. It has a back as well as a front, and here’s the back. The interface consists of both the front, with the user controls, and the back, with all the wires going to the rest of the world.

How does this relate to objects? The public methods of an object are just the front view: the user controls. The interface consists of the public methods provided to users and the methods of other objects that the object calls. But in design we tend to ignore the back and worry about the front only. UML encourages this, by the way.

Grogono gives credit to Brian Shearing for this "calls-out-the-back" problem. Peter went into more depth in his talk, but this idea alone is something which rocks my world.

Cognitively I feel a Boa constrictor which just swallowed a goat. I am going to have to go away and digest it a bit. Maybe you care to tell me whether or not this is obvious, and if it is why don't more programming / specification languages address it. Or you can try to convince me why we shouldn't be considered about what dangles out the back of the boxes.

Talk Back!

Have an opinion? Readers have already posted 46 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Christopher Diggins adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.

This weblog entry is Copyright © 2006 Christopher Diggins. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us