Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a70751

Browse files
pattern question
1 parent c917c44 commit 3a70751

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ At the beginning, it was the repository with questions from Java interviews. Cur
214214
- [How to initialize object depends on type?](patterns.md#how-to-initialize-object-depends-on-type)
215215
- [Why Dependency Injection is needed?](patterns.md#why-dependency-injection-is-needed)
216216
- [Should services always return dtos?](patterns.md#should-services-always-return-dtos)
217+
- [The difference between adapter and decorator?](patterns.md#the-difference-between-adapter-and-decorator)
217218

218219
## DDD
219220
- [What is DDD?](ddd.md#what-is-ddd)

patterns.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [How to initialize object depends on type?](#how-to-initialize-object-depends-on-type)
1111
- [Why Dependency Injection is needed?](#why-dependency-injection-is-needed)
1212
- [Should services always return dtos?](#should-services-always-return-dtos)
13+
- [The difference between adapter and decorator?](#the-difference-between-adapter-and-decorator)
1314

1415
## Which architectural patterns you know?
1516
+ Layered Pattern
@@ -79,4 +80,11 @@ Dependency injection is one of two ways of how to remove dependencies in your co
7980
- https://stackoverflow.com/questions/21554977/should-services-always-return-dtos-or-can-they-also-return-domain-models
8081
- https://vaadin.com/learn/tutorials/ddd/ddd_and_hexagonal
8182

83+
## The difference between adapter and decorator?
84+
**Decorator**, attach additional responsibilities to an object dynamically.
85+
86+
**Adapter**, adapts interface of an existing class to another interface.
87+
###### Relative links:
88+
- https://stackoverflow.com/questions/42737096/design-patterns-adapter-pattern-vs-decorator-pattern
89+
8290
[Home Page](README.md)

0 commit comments

Comments
 (0)