I have a question about an issue I always seem to run into when building a domain model. The issue comes up whenever a domain object is used in what I am calling an "offering" scenario and in a "usage" scenario. For example, let's take a small school.
This school offers programs of study. Each program requires that a student enroll in and complete a certain number of classess of a certain type. In other words, one program may require 2 "general education" type classess, and one "math" type coruse. Here is the domain model for this:
This is all fine so far. Now, let's consider the student enrolling in this program. The student has the option to select from 2 "general education" classess and one "math" class. Once these classes are selected they need to be associated with the program the student is enrolled in. Here is a domain model for this:
Both of these domain models seem fine. However, when you add them together you get something that is not clear at all. You get the following:
This is confusing because you cannot tell what relationships apply to which scenario (the "offering" or the "usage", in other words, the offered programs and the ones that a student has enrolled in). It looks like programs that the school offers might already have selected classes. Alternatively you might think that even after a student is enrolled in a class there are still class options.
Is there a general way to deal with this issue? I find that it presents itself in most businesses and therefore software projects. Are there domain modeling "patterns" for things like this?
Thanks for any help that can be provided.