Exploring the Service Factory Pattern
The Service Factory pattern has its roots in classic object-oriented design patterns such as the Abstract Factory pattern from the Gang of Four’s book, Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley, 1995). The idea is simple: You should isolate points of variability into contained, easily manageable blocks of code. For example, the P.T. Monday Coffee Company application can use one of several different bean suppliers to provide raw beans that it subsequently roasts and sends to customers. Deciding which supplier to use is a point of variability and should therefore be isolated to its own module of code. However, the interface to any supplier’s ordering Web Service should not be a point of variability and should adhere to a single interface. The code to interact with a service can therefore remain in the primary code path. The Service Factory pattern isolates the code for deciding which supplier’s Web Service to use. The Web Service pattern implementation returns an architecture adapter to the service that the factory decided on and allows the primary code path to continue without any customization.
KeywordsBusiness Process Application Program Interface Coffee Bean Service Interface Business Object
Unable to display preview. Download preview PDF.
- •.ebXML: http://www.ebxml.org
- •.Oasis: http://www.oasisopen.org
- •.Carey, James; Carlson, Brent. Framework Process Patterns: Lessons Learned Developing Application Frameworks. Addison-Wesley, 2002Google Scholar
- •.Carey, James; Carlson, Brent; Graser, Tim. SanFrancisco Design Patterns: Blueprints for Business Software. Addison-Wesley, 2000Google Scholar
- •.Fowler, Martin et. al. Patterns of Enterprise Application Architecture. Addison-Wesley, 2002Google Scholar
- •.Gamma, Erich et. al. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995Google Scholar