Skip to content

Data Mapper #34 - #417

Merged
iluwatar merged 16 commits into
iluwatar:masterfrom
inbravo:master
Apr 23, 2016
Merged

iluwatar merged 16 commits into
iluwatar:masterfrom
inbravo:master

Conversation

@inbravo

@inbravo inbravo commented Apr 6, 2016

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown

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

iluwatar commented Apr 16, 2016 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

Coverage Status

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

@inbravo

inbravo commented Apr 18, 2016

Copy link
Copy Markdown
Contributor Author
  • 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
Copy Markdown

Coverage Status

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

@iluwatar

Copy link
Copy Markdown
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

inbravo commented Apr 19, 2016 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

inbravo commented Apr 20, 2016 •

Copy link
Copy Markdown
Contributor Author
  • 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
Copy Markdown

Coverage Status

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

@inbravo

inbravo commented Apr 21, 2016

Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown
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