| Home | Previous Lesson: Course 3:: Session 24 :: Page 50 Next Lesson: Course 3:: Session 24 :: Page 70 |
| Service Oriented
Class Libraries In this methodology, all the functionality is encapsulated into reusable classes (called as service classes), typically, non-visual custom classes. When an object needs certain functionality, let the object request the service from the service class. For the sake of example, we have a DataWindow user object in which we want to provide all the required functionality.
Fat DataWindow User Object In the traditional way, what we have done is, we would have defined the methods in the DataWindow user object it self. At run-time what happens? A fat object that needs more resources. Why the object is fat? Because, we have defined all potentially required methods in the object it self.
In the service-oriented methodology, what we are doing is, define all functionality separately, one object for each functionality, i.e., one class for sorting, one for filtering, one for find & replace and so on. When the DataWindow needs a functionality, say, sorting, it requests the service from the sort service. That means we instantiate only those service classes that are required. In technical terms this is called delegation and in consultant terminology its called as out-sourcing. In this example, DataWindow is delegating the work to different services. Its something like a client/server model. The client ( DataWindow user object ) requests server ( service class ) for the service. The server (service class) does the actual work that is requested by client ( DataWindow user object). In this methodology, we use events at the client ( DataWindow user object ) to route the requests to the appropriate service class. This approach has its own merits & de-merits. The advantages over weigh the disadvantages. Disadvantages:
Advantages:
|
| Home | Previous Lesson: Course 3:: Session 24 :: Page 50 Next Lesson: Course 3:: Session 24 :: Page 70 |