Can anyone help me in domain model diagram. How can we show if condition in domain model diagram
For Example: A Student can take 4 core courses and two optional courses, if core courses are filled by students and no more available then he can take more optional courses
In domain model we cant show if condition. In domain model we would have to represent both conditions as different entities with some attributes and with some association.
Related
I'm having trouble picking end points for two similar queries. So my db entities are User and Course, they have 2 relationships between them. The first relationship is M to M: A user is learning many courses and a course can be learned by many users. The second relationship is 1 to M: a course can be edited by one user and a user can edit many courses. Now for the API endpoints, I need to get:
all the courses a user is learning
all the courses a user can edit
I can only see /users/me/courses as a potential endpoint, but how do I distinguish between the relationships that I want the query based on in the end-point?
What about:
/users/me/editable-courses
/users/me/joined-courses
Hello I have the following situation:
I have a product instance table that is nothing more than a product already assigned to a department and employee.
Well, but I have the following business logic: the product can be an equipment, or a component, that is, a product can have children.
thinking how a computer case is a device that has patrimony_code, and has child products (components) such as:
motherboard,
memoirs,
vga
etc etc
and all of these components are connected to the equipment.
I arrived at this with less table:
But I encountered some problems:
my components would not need departament_id, as they do not belong to the department but to the equipment that there belongs to the department.
So I came to this modeling, but I don't know if it is a good thing to do this relationship, could someone help me if there is a more clean / solid solution for this?
if I have understood your description correctly, only a piece of equipment can be assigned directly to a department, not the individual components that make up the piece of equipment?
Assuming this is the case then I suggest you split this problem into 2 separate tasks as they are, in reality, unrelated and trying to treat them as a single model is causing confusion:
Model the relationship between an instance of a piece of equipment and a department
Model the hierarchy of components (and their instances) that make up a piece of equipment
Once you have these two models you can then relate them if you need to but logically they are separate and you can change one without affecting the other
Hope this helps?
UPDATE 1
(in response to your questions)
You construct 1 sub-model that covers your Equipment entity and the Component entity (plus any other relevant entities) that describe how your products are modelled.
Your construct a second sub-model that describes how equipment is assigned to a department.
The only entity that would be (necessarily) common to the 2 sub-models is the Equipment entity; though, obviously, you can display both sub-models on the same diagram if that is required - even though they are logically separate (apart from the one common entity: Equipment)
Can an Entity Relationship diagram model question have multiple correct answers?. (Simply, Is there only one correct model for an ER Diagram?).
ERD (entity relation diagram ) it's logical step Can one see relation is a ternary between 3 tables and another one see the best answer to be many to many . It's debend on requirements and your view.
I am trying to understand why this statement in the book is wrong: "given a C entity, there is at most one related A entity and at most one related B entity".
Is it that it doesn't apply to a specific kind of relationship??
So, if I have an example of a student who is in attendance to a course with a type of subject. The entities are student, attendance, course and subject. Student makes attendance in a room. Also, a student can make attendance for a subject. Does this example apply to the statement?
Thanks for your time.
The author probably means: in a single relationship instance (e.g., student-Bob/course-ABC/attendance123). So there is a single student, a single course and a single attendance record linked in that instance.
Not across all relationship instances in the class (where student Bob could attend many classes over time).
I wonder what these two words mean.
I encountered them in Doctrine's documentation, but I can't understand what they mean.
This has to do with whether common usage (within the application domain) would attempt to access both sides of the relationship from the other side... Invoices to products would probably be unidirectional, as athough we often want to know what products are on an invoice, it is unlikely that you would want to know all the invoices that contain a given product.
Stores to products on the other hand is bi-directional, as we could easily want to access both all the products at a specific store, or find all the stores that sell a specific product.
Bi-Directional is not limited to where the relationship is a many-to-many relationship. An employee to supervisor relationship could easily be bi-directional, if, in our domain model, an employee object will need to be able to access the employee's supervisor object, and of course, the supervisors object contains a property that lists all his assigned employees.
One to Many Bidirectional:
State and City, where State has collection property of Cities, and City has a State property
Many to Many Unidirectional:
Bus and Rider, where Bus has collection property of Riders, but Rider does not have collection property listing all Buses Rider has ridden in (application does not care).
Many to Many Bidirectional:
Person class, where each person has Friends Property, as Collection of other person objects this person is friends with;
or...
Artist and Album classes, where Artist has Albums collection, and Album has Artists Collection (where album is compilation of tracks from multiple artists)
Example:
We have two tables in database: Student Table, Subject Table
Many-To-Many Bidirectional
You need apply the navigation in the database from the following two directions:
Navigation from Student to Subject
A student can enroll for many subjects in the semester.
Navigation from Subject to Student
A Subject can have many different students enrolled for it.
Many-To-Many Unidirectional
You need apply the navigation in the database from the just one direction:
Navigation from Student to Subject
A student can enroll for many subjects in the semester.