Design Patterns in JavaA design patterns are well-proved solution for solving the specific problem/task.Now, a question will be arising in your mind what kind of specific problem? Let me explain by taking an example. Problem Given: Suppose you want to create a class for which only a single instance (or object) should be created and that single object can be used by all other classes. Solution: Singleton design pattern is the best solution of above specific problem. So, every design pattern has some specification or set of rules for solving the problems. What are those specifications, you will see later in the types of design patterns. But remember one-thing, design patterns are programming language independent strategies for solving the common object-oriented design problems. That means, a design pattern represents an idea, not a particular implementation. By using the design patterns you can make your code more flexible, reusable and maintainable. It is the most important part because java internally follows design patterns. To become a professional software developer, you must know at least some popular solutions (i.e. design patterns) to the coding problems. Advantage of design pattern:
When should we use the design patterns?We must use the design patterns during the analysis and requirement phase of SDLC(Software Development Life Cycle).Design patterns ease the analysis and requirement phase of SDLC by providing information based on prior hands-on experiences. Categorization of design patterns:Basically, design patterns are categorized into two parts:
Core Java Design PatternsIn core java, there are mainly three types of design patterns, which are further divided into their sub-parts:1.Creational Design Pattern
2. Structural Design Pattern
3. Behavioral Design Pattern
|
Monday, 28 January 2019
Design Patterns in Java
Subscribe to:
Post Comments (Atom)
40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot
40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot 1. What is Tight Coupling? When a class (ClassA) is depen...
-
Angular 2, 4,5 and 6 interview questions — Set 3 Update: Answers added Angular template can be defined inline as well as ...
-
40 Latest Interview Questions and Answers on Spring, Spring MVC, and Spring Boot 1. What is Tight Coupling? When a class (ClassA) is depen...
-
React Interview Questions React is an efficient, declarative, and flexible open-source JavaScript library for building simple, fast and sc...
No comments:
Post a Comment