Name

Excessive Layering

Mistake

Unnecessary layers make application inefficient and bloated.

Watch for It When

Adding layers to any application, developing a small application that does not need to scale, or building adaptors to external programs that duplicate functionality of the external program.

Solution

Understand the costs and benefits of each layer in the system. Layers generally have a benefit in terms of either extensibility (providing a reusable interface) or scalability (caching data).

Match the use of layers to the general application type. For example, do not build a complex, multilayered business tier for a small application that simply accesses a local database.

Get J2EE Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.