Giter Site home page Giter Site logo

epam-jmp's Introduction

EPAM-JMP

##Setting up environment

Instal required software

  1. Downloadand install JDK 8 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  2. Download and install Git bash https://git-scm.com/download/win

  3. Download and install Apache Maven http://maven.apache.org/download.cgi

###Set up your git repo

  1. Fork this repository

  2. Clone your repository to your local machine

##Homework submition

When you finished required code locally, push it to your repository on github and create a pull request to this repo.

In pull request mark your mentor (@mentorName) so it can review it.

Hometask 1

To complite task one you need to fix DataProcessorTest unit tests. All methods in DataProcessor with "7" in a name should be implemented using Java 7, when other should be done with Java 8 streaming api.

Hometask 3

The AccidentDataProcessor sequentially reads, enriches and writes accident data to a file. Serial processing takes much time. Use multithreading to run these tasks in parallel and communicate to each other to reduce time.

Below task is optional if somebody is interested to play with more. For more complicated scenario change the PoliceForceExternalDataService.HALT_FOR_TO_TEST_THREAD_HANDLING to 20 min for example to simulate the scenario that enrichment from 3rd party service may get stuck. Currently this service method is being used synchronously. Try to make this call asynchronous.

Hometask 4

In the code what you did on Hometask 3 please create tests to achieve at least 50% test coverage in your new classes. Use IDE plugin to measure. At least 1 integration test is required. Try to use BDD approach.

Recommendations will be :

  1. write unit test for getContactNumber (JUnit)
  2. write unit tests for your service from hometask3 (Mockito/PowerMock: you have to mock all external/additional services which you use in your solution). This part depends on your own solution.
  3. write integration test for your file writing functionality ( don't use any mocks here)

##Hometask 5

Scenarios to be implemented for Homework:

  1. Find all the accidents by ID(Note: We can use findOne method which will accept the Accident ID as PK).
  2. Find all the accidents count groupby all roadsurface conditions .
  3. Find all the accidents count groupby accident year and weather condition .( For eg: in year 2009 we need to know the number of accidents based on each weather condition).
  4. On a given date, fetch all the accidents and update the Time based on the below rules Time Logic: MORNING - 6 am to 12 pm AFTERNOON - 12 pm to 6 pm EVENING - 6 pm to 12 am NIGHT - 12 am to 6 am

Recommendations:

  1. For above scenarios, you can use either Spring JDBC/ORM or use Spring Data as we discussed in the session.โ€‹
  2. Use DI (either setter/constructor) for some dependencies.
  3. For repositories use Autowiring either declarative or Annotation approach.
  4. Please write the entities for all the tables required with all the associations using JPA annotations.
  5. DB related properties will be defined in persistence.xml
  6. JPA will be configured in spring config file which inturn will search for persistence.xml under META-INF/persistence.xml.

Examples are availabe in below package:

com.epam.demo.springdataexample1 -> example1 discussed in session com.epam.demo.springdataexample2 -> example2 discussed in session com.epam.dbrepositories -> All repositories required for Spring Data will be here. com.epam.dbservice -> Service Interface com.epam.entities -> Will have the entities required by JPA incase you are using Spring Data JPA aaproach com.epam.processor. AccidentDBServiceImpl -> will actually interact with Spring Data repositories

epam-jmp's People

Contributors

grtsantu avatar grephari avatar enyalux avatar alexeymatyas avatar

Watchers

 avatar

Forkers

habeeb-shaikh

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.