Decomposition strategies are described in the Cade & Sheil Sun Certified Architect (SCEA) study guide. Or maybe I should say the Oracle Certified Master, Java EE 5 Enterprise Architect (OCMJEA) now. When I read the study guide and and took SCEA part 1, I found this to be very straightforward. Then I read a thread in the CodeRanch certification forum where two people asked for tutorials or examples. I searched online and didn’t find anything so decided to write one.
What is decomposition?
Decomposition is taking a big thing and turning into a bunch of smaller things. In software architecture/design, this is used in designing a system. Suppose you have 1000 classes. How do you separate them into projects and packages that are manageable. Decomposition can also be thought of as organizing or categorizing. (Thanks Scott! This is a good way to put it.)
Types of decomposition
Case & Sheil list the following types of decomposition. It is common not to use all groups in the same system.
- Layering or Distribution – layering refers to layering of the system and distribution refers to distribution of resources. While the book treats these as one category a large system may do layering within a particularly large distribution area. For example, distribution may go by database vs application server. Then layering may happen within the application server.
- Exposure, Functionality or Generality – exposure refers to black box vs white box type exposure on several levels. Functionality is about the business domain (and something we often think about when designing packages.) Generality is about reuse between systems.
- Coupling and Cohesion or Volatility – these should be familiar to any developer. Low coupling and high cohesion insulate packages. And keeping the things you expect to change often away from the other things makes maintenance cheaper.
- Configuration – when environment/outside things change independently of other things, it makes sense to isolate them.
- Planning and Tracking or Work Assignment – when done with everything else, further separating by project management concerns makes sense. Especially when teams are from different organizations.
Suppose I have the following things in my sandwich shop. We want to decompose the list in at least two passes so we have no more than 5 items in a category at the end. How you could decompose the list. What strategy would you use first? Why? What would you do next?
- gift card
- paper cup
- paper receipt
- roast beef
- rye bread
- wheat bread
- white bread
Check part 2 for my answer with explanation. If you want to take a stab at it – either before or after I’ve posted the answer – go for it. There is more than one correct answer. If you post your answer as a comment in this thread, I will give my thoughts on it. If you post it in the CodeRanch/JavaRanch thread, you may get feedback from others as well.