The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

design issue?

All this is in java.

I have this object model. About 15 classes (and almost same number of interfaces) organized heirarchically, each having max 10 operations.
So this is the layer where all the data and related logic resides.
There is a web app on top of this while provides a cool and useful interface to manipulate the data.
So far its all fine.

Now, I want to separate the object model into its own process, independent of the web app.
One option is build a wrapper service around the model. The problem with this is that the model is pretty complex. If every operation becomes a round trip to the service, it defeats the purpose.
Are there any other options?

As an example, lets assume an object model like the DOMDocument. How can I run this in its own separate process?

Wednesday, September 14, 2005
 
 
Fine grained OO access just doesn't work. Provide a high level service interface that provides large chunks of functionality. Use whatever remote API you would prefer (SOAP, RMI, etc). Just trying to expose the methods as remote access points doesn't scale.
son of parnas
Wednesday, September 14, 2005
 
 
An option that has saved me from over-complicated service interfaces in the past is a remote version of the command pattern. Implement a single service that simply executes command objects. Something like

public class DomainServiceImpl {
    public Object execute(Command cmd){
        return cmd.execute(ExecutionContext ctx);
    }
}

public interface Command{
    public Ojbect execute(ExecutionContext ctx);
}

It's VERY important to get the security semantics right because you're basically doing a reverse applet. Also, making the ExecutionContext flexible is key - you may need more than one execute() service but certainly not as many as you would have needed with finer grained interfaces.

Lastly, if you can do Command<T>, the design becomes much more expressive.
matt
Wednesday, September 14, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz