Skip to content

Commit

Permalink
refactor: rename and delete some patterns (#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
iluwatar authored May 23, 2024
1 parent 399970f commit 962e889
Show file tree
Hide file tree
Showing 94 changed files with 972 additions and 3,619 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
@startuml
package com.iluwatar.cqrs.util {
class HibernateUtil {
- LOGGER : Logger {static}
- SESSIONFACTORY : SessionFactory {static}
+ HibernateUtil()
- buildSessionFactory() : SessionFactory {static}
+ getSessionFactory() : SessionFactory {static}
}
}
package com.iluwatar.cqrs.app {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
}
package com.iluwatar.cqrs.dto {
class Author {
- email : String
- name : String
- username : String
+ Author()
+ Author(name : String, email : String, username : String)
# canEqual(other : Object) : boolean
+ equals(o : Object) : boolean
+ getEmail() : String
+ getName() : String
+ getUsername() : String
+ hashCode() : int
+ toString() : String
}
class Book {
- price : double
- title : String
+ Book()
+ Book(title : String, price : double)
# canEqual(other : Object) : boolean
+ equals(o : Object) : boolean
+ getPrice() : double
+ getTitle() : String
+ hashCode() : int
+ toString() : String
}
}
package com.iluwatar.cqrs.commandes {
interface CommandService {
+ authorCreated(String, String, String) {abstract}
+ authorEmailUpdated(String, String) {abstract}
+ authorNameUpdated(String, String) {abstract}
+ authorUsernameUpdated(String, String) {abstract}
+ bookAddedToAuthor(String, double, String) {abstract}
+ bookPriceUpdated(String, double) {abstract}
+ bookTitleUpdated(String, String) {abstract}
}
class CommandServiceImpl {
- sessionFactory : SessionFactory
+ CommandServiceImpl()
+ authorCreated(username : String, name : String, email : String)
+ authorEmailUpdated(username : String, email : String)
+ authorNameUpdated(username : String, name : String)
+ authorUsernameUpdated(oldUsername : String, newUsername : String)
+ bookAddedToAuthor(title : String, price : double, username : String)
+ bookPriceUpdated(title : String, price : double)
+ bookTitleUpdated(oldTitle : String, newTitle : String)
- getAuthorByUsername(username : String) : Author
- getBookByTitle(title : String) : Book
}
}
package com.iluwatar.cqrs.queries {
interface QueryService {
+ getAuthorBooks(String) : List<Book> {abstract}
+ getAuthorBooksCount(String) : BigInteger {abstract}
+ getAuthorByUsername(String) : Author {abstract}
+ getAuthorsCount() : BigInteger {abstract}
+ getBook(String) : Book {abstract}
}
class QueryServiceImpl {
- sessionFactory : SessionFactory
+ QueryServiceImpl()
+ getAuthorBooks(username : String) : List<Book>
+ getAuthorBooksCount(username : String) : BigInteger
+ getAuthorByUsername(username : String) : Author
+ getAuthorsCount() : BigInteger
+ getBook(title : String) : Book
}
}
package com.iluwatar.cqrs.constants {
class AppConstants {
+ E_EVANS : String {static}
+ J_BLOCH : String {static}
+ M_FOWLER : String {static}
+ USER_NAME : String {static}
+ AppConstants()
}
}
package com.iluwatar.cqrs.domain.model {
class Author {
- email : String
- id : long
- name : String
- username : String
# Author()
+ Author(username : String, name : String, email : String)
+ getEmail() : String
+ getId() : long
+ getName() : String
+ getUsername() : String
+ setEmail(email : String)
+ setId(id : long)
+ setName(name : String)
+ setUsername(username : String)
+ toString() : String
}
class Book {
- author : Author
- id : long
- price : double
- title : String
# Book()
+ Book(title : String, price : double, author : Author)
+ getAuthor() : Author
+ getId() : long
+ getPrice() : double
+ getTitle() : String
+ setAuthor(author : Author)
+ setId(id : long)
+ setPrice(price : double)
+ setTitle(title : String)
+ toString() : String
}
}
Book --> "-author" Author
CommandServiceImpl ..|> CommandService
QueryServiceImpl ..|> QueryService
@enduml
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<artifactId>java-design-patterns</artifactId>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>cqrs</artifactId>
<artifactId>command-query-responsibility-segregation</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions commander/src/main/java/com/iluwatar/commander/RetryParams.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
*
* The MIT License
* Copyright © 2014-2022 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.iluwatar.commander;

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

/**
Expand Down
Loading

0 comments on commit 962e889

Please sign in to comment.