iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
89.15k stars 26.38k forks source link

Dependent Mapping pattern #1293

Open iluwatar opened 4 years ago

iluwatar commented 4 years ago

Description: The Dependent Mapping design pattern is used to handle situations where the mapping of one object depends on the mapping of another object. This pattern is particularly useful in scenarios where there are complex relationships between objects and their corresponding database tables. It ensures that dependent objects are mapped correctly and consistently, maintaining the integrity of the data and the relationships between the objects.

Key elements of the Dependent Mapping design pattern include:

  1. Dependent Mapper: This component is responsible for mapping the dependent objects. It coordinates with the main mapper to ensure that dependent objects are correctly mapped and persisted.
  2. Main Mapper: The primary mapper that interacts with the database. It delegates the mapping of dependent objects to the dependent mapper.
  3. Relationship Handling: Proper handling of relationships between the main object and its dependent objects to ensure data integrity and consistency.
  4. Transaction Management: Ensuring that operations involving dependent objects are part of the same transaction to maintain atomicity.

References:

Acceptance Criteria:

  1. Implement the Dependent Mapper and Main Mapper classes that demonstrate the mapping and persistence of dependent objects.
  2. Ensure that the relationship between the main object and dependent objects is correctly handled, with appropriate unit tests to verify the integrity and consistency of the data.
  3. Include comprehensive documentation and examples within the codebase to illustrate the usage and benefits of the Dependent Mapping design pattern.
santyelegy commented 3 years ago

I‘d like to work on this issue. I manage to finish it this month.

ohbus commented 3 years ago

~⭐ Sure thing! Thanks for your interest in our project 😃~

~We will review your PRs in the coming week, Thank you for bearing with us.~

ohbus commented 3 years ago

I can see that @guapi777 has already put a PR for this before I could assign this issue for you.

ohbus commented 3 years ago

I am assigning this issue to @guapi777.

I am extremely sorry for the delayed response to this, please take up any other open issues (there are plenty that needs help) that might b exciting for you to work with.

santyelegy commented 3 years ago

Thanks for your kind suggestion and don't be sorry about this! I and @guapi777 are actually working together on this issue.

Adrianp3623 commented 1 year ago

Hi there, can I take this issue? Thank you!

Adrianp3623 commented 1 year ago

@iluwatar hi, Could I take this issue? Thank you!

iluwatar commented 1 year ago

Yes, go ahead @Adrianp3623

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

iluwatar commented 1 year ago

@Adrianp3623, please address the review comments