Giter Site home page Giter Site logo

stage3-module1-task's Introduction

Architecture advanced

Recommended Timeline

The recommended timeline for the whole module is 1 week.

Business requirements

Develop multi-module gradle application for News Management system with the following requirements:

  • Modules

Application should contain 4 modules: module-main, module-web, module-service and module-repository

The structure of the project can be looks like this.

To make loose coupling between modules should be used parametrized interfaces in each module.

main-module used only for running application.

  • DataSource

  • All fields are required.
  • id field should be auto generated.
  • title field should have length of value from 5 to 30.
  • content field should have length of value from 5 to 255.
  • createdDate, lastUpdatedDate – have ISO 8601 format. Example: 2018-08-29T06:12:15.156. More discussion here: stackoverflow: how to get iso 8601.
  • authorId should be mapped to the author datasource.

The data source should be generated automatically at runtime and saved in array datasource by reading files from the resources folder in the repository module (database emulation).

For example: author.txt, content.txt which should contain the required data.

  • Operations

The system should expose the following operations from the main module in the root project:

  • CRUD operations (what_is_CRUD) for News.
  • Create operation – fill only title, content, authorId and return created object.
  • Get All News operation – return list of objects.
  • Get News by id operation – return object by provided model id.
  • For update operation – update only title, content, authorId by provided model id and return updated object.
  • Delete News operation – delete entity from list objects by provided model id and return boolean value.

All returned and received data should be like DTO type.

The mapping between the DTO and the Model (data source) should be done at the service layer using any library. For example: Mapstruct, Modelmapper.

  • Testing
  • Cover service layer with JUnit tests

General requirements:

  1. Code should be clean and should not contain any “developer-purpose” constructions.
  2. App should be designed and written with respect to OOD and SOLID principles.
  3. Clear layered structure should be used with responsibilities of each application layer defined.
  4. All business logic should be written in the module-service: mapping model to DTO and vice versa, validation, etc.
  5. All the model data should be generated automatically in the module-repository with the amount of 20 and stored in array (database emulation) when the application is running. Reading default data for model generating should be from resources package in author.txt, content.txt and model.txt files.
  6. module-web and module-service should accept and return dto objects.
  7. module-repository should take and return model objects.
  8. Convenient error/exception should be implemented: all errors should be meaningful. Errors should contain errorMessage and errorCode, where errorCode is your custom code.
  9. Application should be tested and pass all tests suites.

Application requirements:

  1. Java 17 should be used.
  2. Gradle. Multi-module project.
  3. Application packages root: com.mjc.school
  4. Java Code Convention is mandatory.

Solution:

The finished sample application can be found in the solution package at the root of the project, which can be run with the following command:

   java -jar model-management.jar

Our solution review:

If you have finished task and would like to see the original solution of it written by our experts, write in #stage-3 channel about it. Access will be provided.

stage3-module1-task's People

Contributors

sultaaann avatar shinitada 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.