Browse DevX
Sign up for e-mail newsletters from DevX


SOA: Refactoring Mainframe Applications into Dynamic Web Applications, Part 1 : Page 4

By refactoring your mainframe applications into Web services you separate presentation from logic, and gain the ability to reuse mainframe data in Web applications. This two-part article describes the complete process.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

The Protocol Abstraction Layer
A protocol-independent framework relies on a protocol abstraction layer to hide the details of each protocol from calling code. Among other benefits, a protocol abstraction layer allows access to services from multiple simultaneous protocols, hides protocol details from the service developer, and facilitates transparent protocol replacement. The diagram in Figure 6 illustrates this concept:

Figure 6. The Protocol Abstraction Layer: The protocol abstraction layer hides protocol details from calling code, providing service access from multiple simultaneous protocols, and facilitating transparent protocol replacement.
As the diagram shows, the service-request interfaces and the service-invocation interfaces do not need to change, regardless of the underlying protocol used. This allows for easy migration without runtime disturbances or changes to the calling code.

The ProtocolProxy factory encapsulates a very simple protocol-layer proxy class. ProtocolProxy is defined as follows:

public class ProtocolProxy { private static Map instances = Collections.synchronizedMap(new HashMap()); public static final String HTTP = "HTTP"; public static ProtocolProxy getInstance( String protocol) { ProtocolProxy instance = (ProtocolProxy)instances.get(protocol); if (instance == null) { // Each protocol type should be represented // by a subclass instance = new ProtocolProxy(protocol); instances.put(protocol, instance); } return instance; } private String protocolType = ""; // Each protocol type should be represented // by a subclass private ProtocolProxy(String protocolType) { this.protocolType = protocolType; } public Object call(BusinessService service, String[] paramValues) throws ServiceException { Object retVal = service.execute(paramValues); if (retVal != null) { return new ServiceModel(retVal); } return null; } }

The RequestProcessor class (see Listing 3) dispatches incoming requests using the ProtocolProxy class.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date