mneri / offer-service Goto Github PK
View Code? Open in Web Editor NEWA RESTful application in SpringBoot.
License: Apache License 2.0
A RESTful application in SpringBoot.
License: Apache License 2.0
The UserSpecification
and OfferSpecification
classes are part of the data layer of the application. These classes are directly imported by the service layer classes violating the dependency inversion principle of SOLID.
Right now there are two mappers:
OfferMapper
which maps all the offer related classes;UserMapper
which maps all the user related classes;There should exist one mapper per application layer: data, service and presentation. This will provide a much more solid isolation between layers.
As in the title.
Entities are part of the data layer and should be isolated. Create an interface for each entity so to hide the implementation from the rest of the application.
The service layer is depending on OfferCreateDto
and OfferUpdateDto
. The dependency should be removed.
Split the OfferRequestDto
into two different objects: OfferCreateDto
and OfferUpdateDto
.
The API returns the complete list of results (users or offers). The result should be paged.
Rename DefaultOfferService
into OfferServiceImpl
and DefaultUserService
into UserServiceImpl
.
Configuration classes are located in different packages. Create a configuration
package and move them inside.
It just does not make sense.
The root package (me.mneri.offer
) should only contain the following packages:
presentation
for the presentation logic;business
for the business logic;data
for the data access logic;share
for the shared interfaces between the layers;configuration
for Spring configuration files.Most CRUD operation inside the controllers are not transactional. Move the business logic from the presentation layer to the service layer and make sure everything is executed inside a transaction.
There exist only 3 different types of exception:
UserIdNotFoundException
UserNotAuthorizedException
OfferIdNotFoundException
These exceptions are often used in the wrong context. For example, UserIdNotFound
is both used when the user is not found or a user exists but is not enabled.
Create more specific types of exceptions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.