Class association necessity - class

The diagram below is based on these facts:
A citizen may make a claim / reclamation on pollutions
An administrator will send the reclamation by type to the appropriate agency / organization, and it will respond with a diagnostic report
This report will be sent by the administrator, to another organization, for the estimation of the solution (costs, etc.).
My problem is to how can I show that Admin will send the claim to an agency? Do I have to make an association between Organization and Reclamation?

If your requirements include that the communication between the Admin and the Organization is to be documented, then you need to take care of this in your class diagram. And, in fact, you already have an item for this: the NotifyOrganization association class. Notice, however, that it's not a good idea to use the questionable UML concept of an association class, which does not have a clear semantics and is confusing. This seems to be confirmed by your flawed modeling of the multiplicities of the NotifyOrganization association, which must not be one-to-one (or 1 to 0..1), but rather many-to-many (* to *).
So, better replace the NotifyOrganization association class with an ordinary class (possibly with an improved name such as Notification) and attach it to Admin and Organization with two many-to-one associations such that each notification is linked to exactly one admin and one Organization.
Notice that a notification represents a (communication/message) event, so Notification represents an event type. It*s quite common in business information models to have both object types and event types, both as classes in a UML class diagram.

...how can I show that Admin will send the claim to an agency?
UML Class Diagram is not show-everything document. In order to document that admin will send claim to agency you can document it effectively using UML Sequence Diagram or some other behavior diagram
...do I have to make an association between Organization and Reclamation?
No, if the agency does not need to care about who exactly delivered the claim or what's the person's role (e.g. "admin"), then you don' have to add it to the class model (and show some association) at all
...diagram...based on these facts...
In order to describe the overall process in a one-page style picture, you (and your business partners) can find very useful the Business Process Model and Notation (BPMN) graphical language in addition to UML

Related

Can I just use the packages in my package diagram as the entities for my class diagram?

We need to create a booking system that allows rape victims to book sessions with a counsellor (who is a volunteer therefore is not on duty 24/7) online. The organisation used to do the booking process over the phone, writing down important information.
This is the package diagram I created for a project. I am not sure: am I allowed to just use the packages as entities for the class diagram?
A package is a tool to structure models by grouping somehow related pieces into namespaces.
It is not unusual to recognize a decomposition that coincides somehow with larger components (e.g. Client, Application and Data). But it is not correct to use packages as a substitute for a class. It may even look confusing.
It is not a problem to keep enclosing or nested packages such as Booking system in a class diagram. But you should use a proper class box for classes. You would then be able to show not only the properties but also the operations in a different compartment. Last but not least, you could be more precise in the relationships between classes, considering that packages are only related via dependencies and some special package operations, whereas classes can be related also with associations, inheritance, etc..
For example, your diagram tells only that Booking is dependent on Client. And this means the content of one package needs to know about the other packages. But in reality Client and Booking should be associated i.e. an instance of Client would be related for a longer time to some specific instances of Booking. In this case, you'd expect that you could easily navigate from the one to the other. Associations also allow to specify multiplicity, e.g. that one client could have 1 or more bookings, but each booking would be for only one client.
Other remarks, unrelated to the question:
Your comment box suggests that you try to explain the purpose of the system, perhaps for some stakeholders. You may therefore consider using a use-case diagram to show the big picture with the different actors and the goals they want to achieve with the system.
In a class box, you could add an «Entity» stereotype above the name of the class. Entities are domain classes that matter to the users.
Data storage system seems not to fit in the diagram: it's not really an entity. Perhaps it's a class, a component or a package, but not really an entity.

Is this UML Object Diagram allowed for this Class Diagram?

I have this basic class diagram:
and was wondering whether this object diagram is allowed:
The class diagram is given and I was wondering whether it is possible to create an object diagram where two customers (maybe wife and husband) are sharing the same bank account with this structure. But because a composition is used, the bank account would get deleted if one of the owners gets deleted right? So this class diagram is not really suitable for shared accounts, right?
This scenario for the objects in the second diagram is indeed not valid. The reason is that composition implies an exclusive ownership.
For an account to be shared by several customers you’d have to change the class diagram, for example:
use aggregation instead of composition (white diamond). Although its semantics are not well defined in the UML specification, it allows in any case for shared ownership.
use a simple association (without diamond). You could express the fact that an account has several customers with an explicit multiplicity.
use a composite client: the client could either be a single person, or a group of several clients. This construct is more complex.

Association class attributes in Domain Model Class Diagram

Hi, I have recently started to learn system analysis and design and am having some trouble understanding domain model class diagram (DMCD) association class.
As per image, when drawing the DMCD, I'd like to understand if an association class is allowed to contain attributes of the classes it derives from. The Invoice needs to contain the attributes apptNo and svcName.
Association class inquiry image:
Do I include the attributes as shown in the image?
Or do I assume that the Invoice would already have these attributes because it is derived from Appointment and Service and that it is not necessary to include them as they can be referred back to the keys apptNo and svcID?
I am confused about the concept. How should I present the association class?
Can someone please provide some guidance?
Thank you.
As already pointed out by Geert Bellekens in his comment above, you don't repeat any of the attributes of the classes involved in an association class in the association class. You only include attributes that specifically characterize the links classified by the association class.
In your example, you should only include attributes that are specific for Invoice links, such as invNo, invDate and totalPrice.
This rule holds independently of the kind of class diagram (domain/design/implementation model).
However, your model is only good for invoices refering to one appointment and one service. It does not account for invoices concerning one appointment, no matter how many services it includes. In a model for this business logic, Invoice would no longer be an association class, but an ordinary class associated with Appointment. This would allow it to access each service included in an appointment and turn it into an invoice line.
To make it short:
is (sort of; please read the comments below) an alternative notation for
which means that Class3 already has associations to both Class1 and Class2. So there's no point in adding attributes of the latter in the association class. If you're on a DB level you eventually introduce redundancy for performance reason at the cost of violating the principle of single source of truth. But that's another story.
It depends.
A domain model class diagram models the concepts found in the domain, i.e. the part of the real world relevant for your project. In the classes, you only include attributes that are indicated by domain experts or by other sources describing the domain.
I will assume that a domain expert knows what an appointment number and a service name are. If these were just technical data, they should not be attributes of Appointment and Service in the first place. To determine whether these attributes should also be included in Invoice, you need to ask domain experts what they think. Does an invoice always include an appointment number and a service name? Only if the domain expert says "Yes", I would model them as attributes of Invoice.
(To double check, you could ask "Is it also valid to say that the appointment number is not part of the invoice, but that the invoice is somehow associated with an appointment having a particular appointment number?")
Maybe the domain expert says an invoice does not contain the appointment number or the service name, because the corresponding Appointment and Service are always associated to the Invoice as attachments or hyperlinks or otherwise. In that case, the fact that Invoice is an association class on the association between Appointment and Service is enough. You don't have to include attributes of these classes in Invoice. These will probably be added later, when the domain model class diagram is turned into a system model class diagram or database model class diagram.

Modelling "services" in a uml class diagram

In one on my software engineering homework i need to make the class diagram for modelling the problem of develop a system for a public library that can manage its loan service.
In this scenario i have an user, that can loan trough a loan service some library material (like audio dvd, video, text like book or something else).
This is the rapid blueprint:
Now my questions are:
Q1: How can i model the association between user and the loan service? and , exactly, what is the name of this association?
Q2: The loan service class only have one istance, because i think that the service is global for all user, so is correct to modelling this in the cardinality of the association?
Thank's in advance.
When you are to make an information model for the business operations of an organization (in your case, a public library), you have to identify all entity types involved (e.g., users, media types, media items such as books and DVDs, loans, reservations, etc.) and the associations between them (e.g., the class User would be associated with Loan).
But you don't include a class for the organization itself (or its information system) in the model. Consequently, do not include a class for "loan service".
This approach results in an information design model that is the basis for deriving both an OOP class model for defining model classes (also called entity classes) and a database table model (e.g., for defining a MySQL database schema).
The model/entity classes provide the foundation for your app or IS.
Depending on your app development approach (e.g., the chosen framework), you may have to design other classes (e.g., for the user interface), but, compared to the model/entity classes, they are less fundamental.

Domain Modeling or class diagram for car dealership

I am trying to draw a domain model or class diagram in UML for car dealership. I am stuck with how to present test drive in the model. One way is to have appointment class and then test-drive as sub class. A dealer also offers after-sale vehicle service so i could have appointment/booking class as super class and then vehicle service and test-drive as two sub classes.
Another way is to have the customer class have a direct relationship with test drive class and vehicle service class under appointment class.
A dealer also sells new and used cars and their parts.
A dealer also offers finance for car sale.
Would testdrive class have relationship with vehicle class or there is separate class for display and testdrive class?
Another question is how do I show potential customers and their inquiries about sale and service in the model. A dealer wants to save details of potential customers if they allow for marketing purposes. Shall I have two classes: one for customers and one for potential customers or it can be achieved just by using an attribute in customer class?
You can really only distinguish the right decision by having a good set of use cases or expected behaviors of the model.
This will inform whether a particular sub-classing is really accurate.
I can see that an appointment might contain several test-drives, which are themselves linked to individual vehicles, So a test-drive itself is nothing more than a link from a customer to a vehicle which are linked to an appointment.
test-drive would contain the information relevant only to the test-drive:
reference to the customer - even this might be debatable to include
reference to the vehicle
length of test drive
location (perhaps the vehicle was driven at a different location than could be determined from the owning appointment)
customer temperature (hot or cold - i.e. did the customer seem enthusiastic)
comments
etc.
But what is not in the test-drive object is anything related to the appointment - since it is always contained in a collection - possibly as part of an appointment or some other event container. Now if the containers which can contain test-drives always include customer information, I might not even include the customer reference in the test-drive object - after all, it will be redundant.
It depends if test-drives can occur in non-appointment scenarios - perhaps at a "sales event" or an "open house" or something where appointments are not actually created in the use cases - or if test-drives for multiple customers will occur within a container.
The second part of your question has been forgotten (easily done when you ask two questions in one):
Another question is how do I show potential customers and their inquiries about sale and service in the model. A dealer wants to save details of potential customers if they allow for marketing purposes. Shall I have two classes: one for customers and one for potential customers or it can be achieved just by using an attribute in customer class?
I think your use case there is "A dealer wants to save details of potential customers if they allow for marketing purposes." and the simplest solution is to have a Mailing List collection which holds name and address of each potential customer.
I think you miss the point. The aim of the domain model is make famliiar you with the domain:
-- What kind of entities you have in yor domain?
-- If they are important for your system under desing,
what kind of properties they have, how they behave?
-- What kind of business rules they obey?
The rest is details. Think like a map maker. Record what there is.Create a simple map so you can not lost your way in that domain. Not try to invent.Abstract what exist in the domain: Not run behind the "fancy abstractions" you created yourself.
Domain model can be used as a source
for object oriented analysis/design.
But their aim is not to represent
software abstractions.