Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Next commments strarting from most important:
- 1) Validation framework:
- - In general it is good idea when objects can handle it's own validation. But self-written implementation is suck. Java already had implement it for you: javax.validation package. And this validation approach could be reused as far as with rest framework like javax.ws.rs or for persistence engine like hibernate. Write own bycicle is arguable desing.
- - In details:
- Every object return hard-coded String of possible error it is have. If no errors object returns empty string. BUT when it is a list of objects and try to validate them all - it is not possible to distinguish which exactly objects incorrect.
- 2) Model objects is not clean and has dependency on exact json parsing library implementation. For example typical constructor signature is:
- public Option(JSONObject json) {
- default constructor not available.
- JSONObject came from json-simple:1.1.1. Now we can't reuse model objects without it library.
- What was the reson to use simple-json? Perfomance? Easy to use? I would not stop on this library.
- 3) Is it a web app? The only rest api it is exposes is only one
- @GET
- @Produces("application/json")
- public Response main() {
- and in this method it is load test data from war file and validate it. I would expect it is able to validate separate TradeInformation.
- 4) public class Util
- public static <T> boolean listContainsClass(Collection<?> arrayList, Class<T> clazz)
- - could be replaced with java 8 lambdas in one short line. And in advance - this class is used only in tests while resides in main source folder and will be not used in prod code.
- 5)Using System.out.println, let see how many times:
- (Get-ChildItem -Filter "*.java" -Recurse | Select-String -pattern "System.out.print" -AllMatches)
- src\App.java:28: System.out.print(tradeInformationValidator.validate());
- src\dataProvider\JSONDataProvider.java:29: System.out.println("File " + source + " not found");
- src\tradeinformation\model\Option.java:45: System.out.print("Wrong data format");
- src\tradeinformation\model\TradeInformation.java:42: System.out.print("Wrong data format");
- src\tradeinformation\model\TradeInformationWithValueDate.java:25: System.out.print("Wrong data format");
- will be refactoring for using logging. Searching for every System.out could not be so handy. Is familiar with slf4J?
- 6) Commiting unnecessary eclipse files. Familiar with .gitignore and with git usage?
- 7) While mvn clean install is able to run, don't follow strict maven folder structure. Why?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement