Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:10:07+00:00 2026-06-15T13:10:07+00:00

at first We have a model like class Person extends EntityBase<Person, PersonNumber>{ private PersonNumber

  • 0

at first We have a model like

class Person extends EntityBase<Person, PersonNumber>{
 private PersonNumber personNumber;
 private String name;
 private Contact contact;
 private String educationLevel;
}
class Contact extends ValueObjectBase<Contact> {
  private String phone;
  private String address;
  private String contactPerson;
}

but now we have to integration with anther system name “System DC”, the original person table been take apart, the personNumber,name, phone,address column now moved to “System DC” . And “SystemDC” provide a database view “DC_PersonView” to us for query.If we need to create a person we have to do call webservice from “SystemDC”.

so we define a personDTO like

 class PersonDTO{
 private PersonNumber personNumber;
 private String name;
 private String phone;
 private String address;
 }

plan 1:

  1. refactor person to IPerson interface
  2. define a PersonWrape Class

    class PersonWrape implements IPerson {
     private Person person;
     private PersonDTO personDTO;
    }
    
  3. in PersonWrape repository

    void SavePerson(IPerson person) {
      systemDC.saveWebservice(person.getPersonDTO);
      personRepository.save(person);// map the column not in systemDC like  educationLevel to our person table.
      }
    

plan 2:
only modify the personRepository:

    void SavePerson(IPerson person) {
      PersonDTO personDTO = PersonDTO.fromEntiry(person);
      systemDC.saveWebservice(personDTO);
      personRepository.save(person);// map the column not in systemDC like  educationLevel
      }

but query person will be truble..

How do we model under this situation? please give us some suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:10:08+00:00Added an answer on June 15, 2026 at 1:10 pm

    It seems like you have an integration scenario between two bounded contexts (BC). In these scenarios, it is often possible to discern a relationship BCs that can determine how entity changes are propagated.

    In your use case is appears that you have a single notion of a person (each person has a single identity shared among BCs), but you have 2 different BCs where a person is manifest with each BC containing and managing different person data. Then the save operation that you discuss is actually two save operations, one in each BC. Each BC saves information that it is interested in. If you have a use case, such as a UI form that accepts person information for both BCs, that use case should send the save command to both BCs explicitly. Your plan 2 is closest to this approach, however I would not place that code in the repository. Instead, I would call two distinct services directly from the presentation layer or the application layer.

    What you can also consider is whether there is some sort of downstream relationship between your original BC (let’s call it A) and System DC. For instance, if DC is downstream from A for person data, then instead of calling both services explicitly during a save, you can implement an event-driven approach. With this approach, A would publish events regarding changes to person data and an integration point between A and DC would subscribe to those events and make the appropriate modifications in DC. Note that this approach is usually eventually consistent. Overall, the event-driven approach is more complicated but also more flexible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django model that looks something like this: class Person(models.Model): name =
I'm using the Code First approach and have the following Model: public class Person
I have a model class like following public class ProductModel { string ProductName {
I have codeigniter model like this <?php class Model_Login extends CI_Model{ function __construct(){ parent::__construct();
I have an SQLAlchemy model like the one below, and at first it didn't
I want to turn Model.attribute into Attribute.models. e.g. I currently have Model.first.attribute => string
I have an entity defined as in a db First Model: public class Merlin_BR_Condiciones_Item
I have a basic model: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) state
If I have a RoR model person.rb as follows: class Person < ActiveRecord::Base attr_accessible
I have a column model like that: ... {name:'password',index:'password', width:100}, {name:'type.name',index:'type.name', width:100}, ... My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.