Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Mapper #34 #417

Merged
merged 16 commits into from
Apr 23, 2016
Merged

Data Mapper #34 #417

merged 16 commits into from
Apr 23, 2016

Conversation

inbravo
Copy link
Contributor

@inbravo inbravo commented Apr 6, 2016

A basic data-mapper implementation based on discussion on #34

@inbravo inbravo mentioned this pull request Apr 6, 2016
@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.008% when pulling 06e0a15 on inbravo:master into d631585 on iluwatar:master.

@inbravo inbravo changed the title data-mapper-34 Data Mapper #34 Apr 7, 2016
@iluwatar
Copy link
Owner

iluwatar commented Apr 16, 2016

Review comments:

  • StudentFirstMapper and StudentSecondMapper seem very similar. Can we drop one of them to simplify the example? You wouldn't need to process command line parameters in App after the change.
  • In App the conditional use of Logger is confusing. Could we just output the debug log without testing any conditions?
  • DataMapperException seems to forward the call to super in most of its methods. In this case you can leave out the implementation because it's the default behavior.
  • You could add unit test for Student to verify that equality testing works
  • Datamapper module is missing from the main pom.xml

package com.iluwatar.datamapper;

import java.util.Optional;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add JavaDoc

@iluwatar
Copy link
Owner

@inbravo you have my review comments. Please notify me once you've addressed them.

@iluwatar iluwatar self-assigned this Apr 16, 2016
First review changes++
@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.008% when pulling 8529d6e on inbravo:master into d631585 on iluwatar:master.

@inbravo
Copy link
Contributor Author

inbravo commented Apr 18, 2016

  • StudentSecondDataMapper is dropped and StudentFirsDataMapper is renamed to StudentDataMapperImpl for better readability.
  • Conditional usage of logger in App class is discarded.
  • DataMapperException is forwarding calls to RuntimeException which is a core Exception class but not any reference from implementation. This is helpful in detailing users about removing all data-mapper exception dependency from code. Please review again.
  • Student equality test is added at StudentTest
  • Your last point is not clear to me; please share more information on it.

I hope just a final review is required.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.008% when pulling 32736fc on inbravo:master into d631585 on iluwatar:master.

@iluwatar
Copy link
Owner

@inbravo took another look. Here are my comments:

  • DataMapperException defines additional constructors that are never used. These should be removed.
  • You should add data-mapper as a module to the main pom.xml Look for <modules> declaration and see how the other modules have been added.
  • (optional improvement) Since this is a database related pattern it would be great to see actual real database underneath.

Please comment when you're ready for another look.

@inbravo
Copy link
Contributor Author

inbravo commented Apr 19, 2016

Parent info is required, i am giving this, please review, build is failed

<parent>
    <groupId>com.iluwatar</groupId>
    <artifactId>java-design-patterns</artifactId>
    <version>1.7.0</version>
</parent>

@iluwatar
Copy link
Owner

Looks like you have the wrong version number. Try this:

<parent>
    <groupId>com.iluwatar</groupId>
    <artifactId>java-design-patterns</artifactId>
    <version>1.12.0-SNAPSHOT</version>
</parent>

@inbravo
Copy link
Contributor Author

inbravo commented Apr 20, 2016

  • Unused constructors from DataMapperException discarded
  • Main build file updated for addition of new module
  • You are absolutely correct it should be DB based; My initial check-in was based on DB in fact. Let me see if i can do this ... (i analyzed and it seems that it will be complete redo, now it depends on you to take the final call...)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 90.713% when pulling af1db79 on inbravo:master into d631585 on iluwatar:master.

@inbravo
Copy link
Contributor Author

inbravo commented Apr 21, 2016

This pattern is ready for release; you can plan out ....

@iluwatar iluwatar merged commit 5b72510 into iluwatar:master Apr 23, 2016
@iluwatar
Copy link
Owner

@inbravo I've merged the initial implementation. Looking forward to the real database implementation though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants