Coder Social home page Coder Social logo

offer-service's People

Watchers

 avatar  avatar

Forkers

kiumb

offer-service's Issues

Add transaction support to CRUD operations

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.

Move configuration classes

Configuration classes are located in different packages. Create a configuration package and move them inside.

Rename service classes

Rename DefaultOfferService into OfferServiceImpl and DefaultUserService into UserServiceImpl.

Reorganize packages by layer

The root package (me.mneri.offer) should only contain the following packages:

  1. presentation for the presentation logic;
  2. business for the business logic;
  3. data for the data access logic;
  4. share for the shared interfaces between the layers;
  5. configuration for Spring configuration files.

Create interfaces for specification classes

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.

Rewrite mappers by layer

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.

Create more specific type of exceptions

There exist only 3 different types of exception:

  1. UserIdNotFoundException
  2. UserNotAuthorizedException
  3. 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.

Create an interface for each entity

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.