#348 Data Transfer Object design pattern #608
Merged
Conversation
added 6 commits
Aug 9, 2017
… to server at one shot.
|
The project file for the class diagram is missing (.ucls) |
data-bus/pom.xml
Outdated
| <packaging>pom</packaging> | ||
| <modules> | ||
| <module>../data-transfer-object</module> | ||
| </modules> |
iluwatar
Aug 12, 2017
Owner
Why is Data Bus pattern affected? Should this change be reverted?
Why is Data Bus pattern affected? Should this change be reverted?
| customers.add(customerOne); | ||
| customers.add(customerTwo); | ||
|
|
||
| CustomerResource customerResource = new CustomerResource(customers); |
iluwatar
Aug 12, 2017
Owner
This is customer server data initialization, right? Could we move to static block in CustomerResource class?
This is customer server data initialization, right? Could we move to static block in CustomerResource class?
gopinath-langote
Aug 13, 2017
•
Author
Contributor
@iluwatar Yes, we can. But the unit tests for the CustomerResource class will not be pure. As the class itself is having some initial data. Don't you think the unit tests will be more confusing one?
@iluwatar Yes, we can. But the unit tests for the CustomerResource class will not be pure. As the class itself is having some initial data. Don't you think the unit tests will be more confusing one?
| } | ||
|
|
||
| private static void printCustomerDetails(List<CustomerDto> allCustomers) { | ||
| allCustomers.forEach(customer -> System.out.println(customer.getFirstName())); |
iluwatar
Aug 12, 2017
Owner
Don't use System.println, instead add and use a logger as in other examples.
Don't use System.println, instead add and use a logger as in other examples.
| public class CustomerDto { | ||
| private String id; | ||
| private String firstName; | ||
| private String lastName; |
iluwatar
Aug 12, 2017
Owner
This looks like immutable class. The private members should be declared final.
This looks like immutable class. The private members should be declared final.
added 6 commits
Aug 13, 2017
This reverts commit db10b93.
|
@iluwatar : Added missing class diagram. Thanks. |
|
@gopinath-langote looks good now. Thanks for the contribution! |
kspalaiologos
pushed a commit
to kspalaiologos/java-design-patterns
that referenced
this pull request
Jan 17, 2021
iluwatar#348 Data Transfer Object design pattern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Basic version of Data transfer object pattern implementation.