The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Distribution Strategies

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bill Venners

Posts: 2285
Nickname: bv
Registered: Jan, 2002

Distribution Strategies Posted: Sep 6, 2002 1:35 PM
Reply to this message Reply
"A procedure call within a process is very, very fast. A procedure call between two separate processes is orders of magnitude slower. Make that process a process running on another machine and you can add another order of magnitude or two - depending on the network topography involved.

As a result of this you need a different kind of interface for an object that's intended to be used remotely from one that intended to be used locally within the same process.

A local interface is best as a fine grained interface. So if I have an address class - a good interface would have separate methods for getting the city, getting the state, setting the city, setting the state etc. A fine grained interface is good because it follows the general OO principle of lots of little pieces that can be combined and overridden in various ways to extend the design into the future.

A fine grained interface does not work well, however, when you have a remote interface. When method calls are slow, you want to obtain or update the city, state, and zip in one call rather than three calls. The resulting interface is coarse-grained, designed not for flexibility and extendibility but for minimizing the calls. Here you'll see an interface along the lines of get address details and update address details. This coarse grained interface is much more awkward to program to, but for performance you need to have it.," says Martin Fowler in this chapter from his next book:

Topic: Perfection and Simplicity Previous Topic   Next Topic Topic: Refactoring: Rub a dub dub

Sponsored Links


Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use