There really is no better example for a layered architecture than TCP/IP. This pattern involves stacking different services on top of each other, each performing a task. If the current layer can't not handle the request, it sends it further down the line until it can. Then the final answer is sent back up the stack. Another form of this architecture is the bottom-up approach. This is where the information flows from the lower levels, like a driver for example, up the stack getting translated and modified along the way, til it reaches the user. Of course it is possible that the information may not go through all the layers in order to get serviced in the top-down or the bottom-up approach.
There are ten steps for refining the definition of a layered architecture.
1. Define the abstraction criterion
2. Determine the number of abstraction layers
3. Name the layers and assign tasks to each of them
4. Specify the services
5. Refine the layering
6. Specify an interface for each layer
7. Structure individual layers
8. Specify the communication between adjacent layers
9. Decouple adjacent layers
10. Design an error-handling strategy
I never had to refactor code to use a layered architecture, but having this sort of high level check list would be very handy to get started. I still feel that it could still take lot of careful work in order to make sure that you have done everything properly.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment