1

I'm having trouble defining the boundaries of my bounded context(s). I have the following, simplified/incomplete, versions of the classes in my domain. All of these classes are unique so they are Entities and I think they should be AR's as well, though I'm less sure about that last point. A Customer, User and Carrier are necessary to make a load, but they can all obviously exist without a load. They have validation and other actions that must be completed before they can be added to a Load. User is responsible for initiating CRUD operations on Customer, Carrier and Loads which include adding Carriers and Customers to Loads.

Should Customers, Carriers, Loads and Users each be AR's and/or have their own bounded contexts?

public class Customer
{
    public Guid Id { get; protected set; }

    public string Name { get; protected set; }

    public CustomerStatus Status { get; protected set; }
}

public class Carrier
{
    public Guid Id { get; protected set; }

    public string Name { get; protected set; }

    public CarrierStatus Status { get; protected set; }
}

public class User
{

    public Guid Id { get; protected set; }

    public Role Role { get; protected set; }
}


public class Load
{
    public Guid Id { get; protected set; }

    public LoadStatus Status { get; protected set; }

    public Guid CustomerId { get; protected set; }

    public Guid CarrierId { get; protected set; }

    public Address Origin { get; protected set; }

    public Address Destination { get; protected set; }

    public string Commodity { get; protected set; }

}
4
  • 2
    No one can answer your question about bounded contexts without a much greater understanding of your particular domain. Each of the classes you’ve specified might be its own AR however. Nov 10, 2017 at 20:17
  • 1
    That's how I define bounded context boundaries: medium.com/@wrong.about/… Nov 10, 2017 at 20:56
  • @Zapadlo I think I will make separate BCs for each of these sub domains and make them AR's as well. Nov 11, 2017 at 14:39
  • 1
    That can make sense -- I just don't have enough details about your domain. If these ARs are involved in some business process, then using saga might be a good fit. Here is a more higher-level example of it: medium.com/@wrong.about/… , and this is more lower-level example: medium.com/@wrong.about/… . If you have any questions, don't hesitate to ask. Nov 11, 2017 at 14:55

1 Answer 1

1

It appears that this question may not be a good question since the rules for defining BC's are fluid. I have decided to make each of the sub domains I mentioned their own BC's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.