GithubHelp home page GithubHelp logo

refactoring-java's Introduction

Hamid Farmani

I tried to keep the functionalities as is but change the package structure. Business logic moved to service package and model classes are now in their own package. The movies' code seemed to be an enum and it will be easier in the future to change, rather than having strings all over the places.

There were multiple "magic numbers" in the code which I tried to extract and move them in a separate file as constants.

A custom exception handler added for the time when rental can not be found. Unit tests with multiple scenarios has been implemented and logs are set.

For the commits, I followed conventional commits and ignored not needed files or directories. Also, there's a formatter which can be run by following command:

mvn com.coveo:fmt-maven-plugin:format 

I added the dependencies such as JUnit and AssertJ in pom.xml file. If I wanted to spend more time and there was a request for it, I would have done the following:

  • Adding at least CRUD functionalities
  • Saving the information in a real database
  • Implementing RESTful APIs for the application to have interaction with user
  • Creating a proper UI
  • More test scenarios/exception handlers
  • Dockerizing the application

To build the app and run the tests:

mvn clean install

You may run the application with following command:

mvn exec:java -D"exec.mainClass"="com.etraveli.refactoring.RentalApplication"

refactoring-java's People

Contributors

hamidfarmani avatar ptrvgl avatar

Stargazers

Mohsen avatar

Watchers

James Cloos avatar

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.