Overview of GOF Design Patterns - Core Design Patterns
In this chapter, you'll be given an overview of GOF Design Patterns, including some best practices for making an application design. You'll also get an overview of common problem--solving with design patterns.
I will explain the design patterns that are commonly used by the Spring Framework for better design and architecture. We are all in a global world, which means that if we have services in the market, they can be accessed across the Globe. Simply put, now is the age of the distributed computing system. So first, what is a distributed system? It's an application that is divided into smaller parts that run simultaneously on different computers and the smaller parts communicate over the network, generally using protocols. These smaller parts are called tiers. So if we want to create a distributed application, n-tier architecture is a better choice for that type of application. But developing an n-tier distributed application is a complex and challenging job. Distributing the processing into separate tiers leads to better resource utilization. It also support the allocation of tasks to experts who are best suited to work and develop a particular tier. Many challenges exist in developing distributed applications, some of which are detailed here:
- Integration between the tiers
- Transaction management
- Concurrency handling of enterprise data
- Security of the application and so on
So my focus in this book is on simplifying Java EE application design and development by applying patterns and best practices with the Spring Framework. In this book, I will cover some common GOF Design Patterns, and how Spring adopted these for providing the best solutions to the aforementioned listed problems of enterprise application because the design of distributed objects is an immensely complicated task, even for experienced professionals. You need to consider critical issues, such as scalability, performance, transactions, and so on, before drafting a final solution. That solution is described as a pattern.
At the end of this chapter, you will understand how design patterns provide the best solution to address any design-related and development-related issues, and how to start development with the best practices. Here, you will get more ideas about GOF Design Patterns, with real-life examples. You will get information about how the Spring Framework implements these design patterns internally to provide the best enterprise solution.
This chapter will cover the following points:
- Introducing the power of design patterns
- Common GOF Design Patterns overview
- Core design patterns
- Creational design patterns
- Structural design patterns
- Behavioral design patterns
- J2EE design patterns
- Design patterns at presentation layer
- Design patterns at business layer
- Design patterns at integration layer
- Core design patterns
- Some best practices for Spring application development