Skip to content

Commit af00f18

Browse files
committed
Updated
1 parent fcfa11a commit af00f18

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

content/posts/java-design-pattern.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FAseries: ["Themes Guide"] #indicates that this post is part of a series of r
99
aliases: ["migrate-from-jekyl"] #Alternative URLs or paths that can be used to access this post, useful for redirects from old posts or similar content.
1010
ShowToc: true # Determines whether to display the Table of Contents (TOC) for the post.
1111
TocOpen: true # Controls whether the TOC is expanded when the post is loaded.
12-
weight: 11 # The order in which the post appears in a list of posts. Lower numbers make the post appear earlier.
12+
weight: 1 # The order in which the post appears in a list of posts. Lower numbers make the post appear earlier.
1313
---
1414
Explain how to use the design patterns. (Creational Patterns)
1515
[Refer1](https://github.com/kamranahmedse/design-patterns-for-humans?tab=readme-ov-file#-simple-factory)
@@ -18,7 +18,7 @@ Explain how to use the design patterns. (Creational Patterns)
1818
[Refer4](https://www.oodesign.com/factory-pattern)<br>
1919

2020
## 1. Creational Design Patterns.
21-
## 1.1 🏠 Simple Factory
21+
## 1.1 Simple Factory
2222
- Factory is an object for creating other objects
2323
- **Use cases:**
2424
- when the class does not know beforehand the exact types and dependencies of the objects it needs to create.
@@ -125,7 +125,7 @@ public class MainTestFactory {
125125
```
126126
<br>
127127

128-
## 1.2. 🏭 Factory Method
128+
## 1.2. Factory Method
129129
- **Factory Method** is a creational design pattern that provides an interface for creating objects in a superclass, but allows subclasses to alter the type of objects that will be created.
130130
- **Use cases:**
131131
- when class cannot anticipate the class of objects it must create.
@@ -241,13 +241,13 @@ public class MainTestFactory {
241241

242242
<br>
243243

244-
## 1.3. 🔨 Abstract Factory
244+
## 1.3. Abstract Factory
245245
- **Abstract Factory** is a creational design pattern that lets you produce families of related objects without specifying their concrete classes.
246246
- **Use cases:**
247247
- when need a way to **create individual furniture objects** so that they **match other objects of the same family**.
248248
- When don’t want to change existing code when adding new products or families of products to the program.
249249

250-
- **Examples:** You intend to manufacture a product line that included a family of related products: A,B,and C - along with several variants such as AWin,ALinux, BWin,BLinux, CWin, and CLinux.
250+
- **Examples:** We intend to manufacture a product line that included a family of related products: A,B,and C - along with several variants such as AWin,ALinux, BWin,BLinux, CWin, and CLinux.
251251
- Design UML:
252252
![image](/images/factory_abstract_pattern.png)
253253

@@ -392,4 +392,17 @@ public class Main {
392392
}
393393
}
394394

395-
```
395+
```
396+
<br>
397+
398+
## 1.4. Builder
399+
- **Builder** is a creational design pattern that lets you construct complex objects step by step. The pattern allows you to produce different types and representations of an object using the same construction code.
400+
- **Use cases:**
401+
- build objects step by step, using only those steps that you really need.
402+
403+
- **Examples:** We need to create some products: A,B and C with multiple optional attributes.
404+
- Design UML:
405+
![image](/images/.png)
406+
407+
- Implementation codes:
408+
`https://www.baeldung.com/java-builder-pattern`

content/posts/java-osgi-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FAseries: ["Themes Guide"] #indicates that this post is part of a series of r
99
aliases: ["migrate-from-jekyl"] #Alternative URLs or paths that can be used to access this post, useful for redirects from old posts or similar content.
1010
ShowToc: true # Determines whether to display the Table of Contents (TOC) for the post.
1111
TocOpen: true # Controls whether the TOC is expanded when the post is loaded.
12-
weight: 1 # The order in which the post appears in a list of posts. Lower numbers make the post appear earlier.
12+
weight: 11 # The order in which the post appears in a list of posts. Lower numbers make the post appear earlier.
1313
---
1414
Explain how to use the OSGi Service
1515
[Refer1](https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/different-between-osgi-services-and-osgi-component/m-p/621761)<br>

0 commit comments

Comments
 (0)