Skip to content

Commit 962e889

Browse files
authored
refactor: rename and delete some patterns (iluwatar#2970)
1 parent 399970f commit 962e889

File tree

94 files changed

+972
-3619
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+972
-3619
lines changed
File renamed without changes.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
@startuml
2+
package com.iluwatar.cqrs.util {
3+
class HibernateUtil {
4+
- LOGGER : Logger {static}
5+
- SESSIONFACTORY : SessionFactory {static}
6+
+ HibernateUtil()
7+
- buildSessionFactory() : SessionFactory {static}
8+
+ getSessionFactory() : SessionFactory {static}
9+
}
10+
}
11+
package com.iluwatar.cqrs.app {
12+
class App {
13+
- LOGGER : Logger {static}
14+
+ App()
15+
+ main(args : String[]) {static}
16+
}
17+
}
18+
package com.iluwatar.cqrs.dto {
19+
class Author {
20+
- email : String
21+
- name : String
22+
- username : String
23+
+ Author()
24+
+ Author(name : String, email : String, username : String)
25+
# canEqual(other : Object) : boolean
26+
+ equals(o : Object) : boolean
27+
+ getEmail() : String
28+
+ getName() : String
29+
+ getUsername() : String
30+
+ hashCode() : int
31+
+ toString() : String
32+
}
33+
class Book {
34+
- price : double
35+
- title : String
36+
+ Book()
37+
+ Book(title : String, price : double)
38+
# canEqual(other : Object) : boolean
39+
+ equals(o : Object) : boolean
40+
+ getPrice() : double
41+
+ getTitle() : String
42+
+ hashCode() : int
43+
+ toString() : String
44+
}
45+
}
46+
package com.iluwatar.cqrs.commandes {
47+
interface CommandService {
48+
+ authorCreated(String, String, String) {abstract}
49+
+ authorEmailUpdated(String, String) {abstract}
50+
+ authorNameUpdated(String, String) {abstract}
51+
+ authorUsernameUpdated(String, String) {abstract}
52+
+ bookAddedToAuthor(String, double, String) {abstract}
53+
+ bookPriceUpdated(String, double) {abstract}
54+
+ bookTitleUpdated(String, String) {abstract}
55+
}
56+
class CommandServiceImpl {
57+
- sessionFactory : SessionFactory
58+
+ CommandServiceImpl()
59+
+ authorCreated(username : String, name : String, email : String)
60+
+ authorEmailUpdated(username : String, email : String)
61+
+ authorNameUpdated(username : String, name : String)
62+
+ authorUsernameUpdated(oldUsername : String, newUsername : String)
63+
+ bookAddedToAuthor(title : String, price : double, username : String)
64+
+ bookPriceUpdated(title : String, price : double)
65+
+ bookTitleUpdated(oldTitle : String, newTitle : String)
66+
- getAuthorByUsername(username : String) : Author
67+
- getBookByTitle(title : String) : Book
68+
}
69+
}
70+
package com.iluwatar.cqrs.queries {
71+
interface QueryService {
72+
+ getAuthorBooks(String) : List<Book> {abstract}
73+
+ getAuthorBooksCount(String) : BigInteger {abstract}
74+
+ getAuthorByUsername(String) : Author {abstract}
75+
+ getAuthorsCount() : BigInteger {abstract}
76+
+ getBook(String) : Book {abstract}
77+
}
78+
class QueryServiceImpl {
79+
- sessionFactory : SessionFactory
80+
+ QueryServiceImpl()
81+
+ getAuthorBooks(username : String) : List<Book>
82+
+ getAuthorBooksCount(username : String) : BigInteger
83+
+ getAuthorByUsername(username : String) : Author
84+
+ getAuthorsCount() : BigInteger
85+
+ getBook(title : String) : Book
86+
}
87+
}
88+
package com.iluwatar.cqrs.constants {
89+
class AppConstants {
90+
+ E_EVANS : String {static}
91+
+ J_BLOCH : String {static}
92+
+ M_FOWLER : String {static}
93+
+ USER_NAME : String {static}
94+
+ AppConstants()
95+
}
96+
}
97+
package com.iluwatar.cqrs.domain.model {
98+
class Author {
99+
- email : String
100+
- id : long
101+
- name : String
102+
- username : String
103+
# Author()
104+
+ Author(username : String, name : String, email : String)
105+
+ getEmail() : String
106+
+ getId() : long
107+
+ getName() : String
108+
+ getUsername() : String
109+
+ setEmail(email : String)
110+
+ setId(id : long)
111+
+ setName(name : String)
112+
+ setUsername(username : String)
113+
+ toString() : String
114+
}
115+
class Book {
116+
- author : Author
117+
- id : long
118+
- price : double
119+
- title : String
120+
# Book()
121+
+ Book(title : String, price : double, author : Author)
122+
+ getAuthor() : Author
123+
+ getId() : long
124+
+ getPrice() : double
125+
+ getTitle() : String
126+
+ setAuthor(author : Author)
127+
+ setId(id : long)
128+
+ setPrice(price : double)
129+
+ setTitle(title : String)
130+
+ toString() : String
131+
}
132+
}
133+
Book --> "-author" Author
134+
CommandServiceImpl ..|> CommandService
135+
QueryServiceImpl ..|> QueryService
136+
@enduml

cqrs/pom.xml renamed to command-query-responsibility-segregation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<artifactId>java-design-patterns</artifactId>
3333
<version>1.26.0-SNAPSHOT</version>
3434
</parent>
35-
<artifactId>cqrs</artifactId>
35+
<artifactId>command-query-responsibility-segregation</artifactId>
3636
<dependencies>
3737
<dependency>
3838
<groupId>org.junit.jupiter</groupId>

commander/src/main/java/com/iluwatar/commander/RetryParams.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
3+
*
4+
* The MIT License
5+
* Copyright © 2014-2022 Ilkka Seppälä
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
125
package com.iluwatar.commander;
226

327
/**

commander/src/main/java/com/iluwatar/commander/TimeLimits.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
3+
*
4+
* The MIT License
5+
* Copyright © 2014-2022 Ilkka Seppälä
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
125
package com.iluwatar.commander;
226

327
/**

0 commit comments

Comments
 (0)