Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vermapratyush/goeurotest
goEuro Assignment
https://github.com/vermapratyush/goeurotest
Last synced: 13 days ago
JSON representation
goEuro Assignment
- Host: GitHub
- URL: https://github.com/vermapratyush/goeurotest
- Owner: vermapratyush
- Created: 2016-10-07T16:21:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-14T08:01:43.000Z (over 8 years ago)
- Last Synced: 2024-11-25T11:44:33.907Z (2 months ago)
- Language: Java
- Size: 4.08 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##GoEuro Assignment
The assignment is a command line program.
Based on the argument passed (CityName), it makes HTTP call to a remote server and writes the output in CSV format.
The output is also printed to the STDOUT.##Structure
The program is a simple JAVA Application.
I have resisted using Spring as in my opinion it would have been an overkill and bloated the executable for
not good reason.The solution is divided into multiple packages:
1. client - Contains classes related to HTTPClient. ThriftClient, ProtoBuf and other code will go here.
* Would have used [Netflix's Hystrix](https://github.com/Netflix/hystrix) (for connection pooling), however for a command line program it is not very useful.
2. exception - Custom exceptions are declared here.
3. mapper - I have used jackson for serialization and deserialization for json-pojo and csv-pojo
4. model - All data models go here, in separate packages for json and csv. It is also possible to create one model and build multiple views. Having multiple views on top of a datamodel will save a lot of code in a large project.
5. service - The interface LocationService gives an idea about the kind of APIs exposed by the service. All the version of LocationService will implement the interface. Each service should return an object with all potential common business logic enclosed.
* It contains an abstract class "Service", which contains the common features of all service we will possibly integrate. In a micro service architecture, it becomes difficult to manage and debug and pin-point a fault. Basic sanity and hygiene practices will go here so that it is inherited by every service.
6. Configuration - Configuration management of the application.##Execution
Since it a maven project
###BUILD
``mvn clean install``###TEST
``mvn test``###RUN
``java -jar goeuro.jar ``
``java -jar goeuro.jar Berlin``