-
-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented Monolithic Architecture according to the guidelines provided by issue #2664 #3111
base: master
Are you sure you want to change the base?
Conversation
…ructure, and added basic model files using H2 database since its light and efficient
…ructure, and added basic model files using H2 database since its light and efficient
…se to maintain code cleanliness
# Conflicts: # Monolithic-Ecommerce/src/main/java/com/iluwatar/monolithic/model/Orders.java # Monolithic-Ecommerce/src/main/java/com/iluwatar/monolithic/model/Products.java # Monolithic-Ecommerce/src/main/java/com/iluwatar/monolithic/model/User.java
…asses and used the CLI main class from the previous submission and enhanced upon it
Added Detailed Readme File in the md format
I am aware of the 40% coverage i'll be adding more test cases and submitting another PR |
added more test cases, and tried to fix pom.xml
Monolithic-Ecommerce/README.md
Outdated
@@ -0,0 +1,126 @@ | |||
## Monolithic-Ecommerce App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md has a specific structure that each example needs to implement. See here: https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could use monolithic-architecture as the folder/module name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revise them as soon as possible
Monolithic-Ecommerce/pom.xml
Outdated
</dependency> | ||
</dependencies> | ||
</project> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include maven-assembly-plugin so that we can execute the app from the command line. See other patterns for examples.
/** | ||
* Main entry point for the Monolithic E-commerce application. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain monolithic architecture brieftly. Describe how the code example implements it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought i went over it as much as i could in the Readme file but i'll include a brief introduction here as well
User user = userRepository.findById(userId).orElse(null); | ||
if (user == null) { | ||
throw new NonExistentUserException("User with ID " + userId + " not found"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could use orElseThrow
in this situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot more sense, I'll revise the code to make sure no other statements stand out like this
Quality Gate passedIssues Measures |
@@ -0,0 +1,136 @@ | |||
## Monolithic-Ecommerce App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md
has a very specific format that is common for all the patterns. See instructions at: https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute
Specifically, take a look at the required front matter structure at the beginning of the file.
* OrderCon is a controller class for managing Order operations. | ||
* */ | ||
@Service | ||
public class OrderCon { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it's longer to write, but I think it would be clearer to name it OrderController
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class Orders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, should this be named Order
? I.e. there is another table for users and it's called just User
.
Take a look at Products
as well.
What problem does this PR solve?
this PR relates to issue #2664, it contains an example for the Monolithic Architecture using MVC file structure, it also builds upon the previously abandoned code and uses a couple of time saving utilities such as Spring Data JPA and Mockito.