UML class diagram for restaurant and Analysis to Design.. - uml

I'm studying for a reexam in OOAD and doing some old exam questions. I'm trying to develop an analysis class model that may be used to manage a restaurant's menus. Here are the requirements:
Several different menus (breakfast,lunch,dinner)
Dishes may exists in several different menus
The restaurant also provides catering
Dishes should keep information which is relevant for guests with special requests (vegetarian,allergies etc..) Special menus may be created using this information as search criteria.
How I should model the catering? Should there be a Menu class and then breakfast,lunch,dinner and special as specialization classes or should I just have one Menu class? Should there be specialization classes for vegetarian,gluten free..etc dishes?
Then I have this question which confuses me a bit..
"What are 4 tasks that must be addressed when you transform this analysis class model into a design model?"
What is meant by this? Are there 4 general tasks/steps that always should be done when translating an analysis model into a design model or is it 4 specific tasks specifically for this analysis class model?
I've looked thorugh the presentations and the book (OOAD with applications) and the only thing I found related to these 4 steps/tasks was in a case study:
■ Identify the architectural elements at the given level of abstraction to further establish the problem boundaries and begin the object-oriented decomposition.
■ Identify the semantics of the elements, that is, establish their behavior and attributes.
■ Identify the relationships among the elements to solidify their boundaries and collaborators.
■ Specify the interface of the elements and then their refinement in preparation for analysis at the next level of abstraction.
Regards

How I should model the catering? Should there be a Menu class and then breakfast,lunch,dinner and special as specialization classes or should I just have one Menu class? Should there be specialization classes for vegetarian,gluten free..etc dishes?
You should be modeling your business requirements. In your case, the requirements you have are from your exam task only. So you will have to decide what you include in your model. Only include in your business domain model what you think you will need to hold a state, or perform an operation on.
Should there be specialization classes for vegetarian,gluten free..etc dishes?
Should be possible to save that in a simple boolean flag in the meal class, don't you think?
The "4 tasks" question is open for interpretation and is probably best answered when you have the documents from your studies available. At least I'd consider the 4 tasks you list a reasonable answer to the question.
Welcome to StackOverflow.
If you post your modeling attempts as a image file, you may receive more detailed help. You may use a service like dropbox to reference graphics until you have enough reputation for uploads to SO.

Class diagram by myself,for reference.

Related

Should I put included use cases from use case diagram in my class diagram?

So, I have designed a use case for a student online system. The issue is that some of my base cases are subdivided into many included cases. For instance, to generate marksheet as a staff, my included use cases are: select student, select course, select module, select semester
In my class diagram, should i have methods for all of the smaller use cases or just the main one like generateMarksheet?
In short
No, that's not how it works.
Some more details
There is no direct mapping in general
Use-cases are about the requirements from a user perspective. So it's about the problems to solve. Typically they represent high level goals for the user such as Manage students or Subscribe to courses.
The classes of your system are about a technical solution that meet these requirements. In general however, there is no direct mapping as you describe: the behavior of the system emerge from the interaction between many classes within the system.
There are some methods to link both worlds
If you want a link between both worlds, you may follow the unified process that was promoted by the founding fathers of UML:
You start with your use-cases
You create an ECB class model for the analysis, in which you show a control class for every single use case, a boundary class for every association between a use case and an actor, and an entity class for every domain object that you can derive from the narrative.
You then think a little more about boundaries and controls, to see if there are some overlaps, or even reuse.
Then you think of designing your system. But the level of detail will be much higher. You'll end up mapping your own solution classes to the analysis classes for the purpose of traceability: for every class you can find back the use-case(s) to which it relates. And conversely.
But this approach has lost traction in an agile context. And also because solution design is often heavily influenced by architectural models chosen (such as MVP, MVVM, clean architecture,...) and these have a different logic than ECB (despite some apparent and misleading similarities), so that this analysis step is not adding sufficient value.
Morover, agile methods try to avoid a big up-front analysis that is required for a rigorous ECB approach.

What uml diagrams can be used for a data science project

I am working on a data science project for my 3-2 mini project. My project analyzes the performance of a country in the Olympics based on some attributes. But I am confused about the UML diagrams I should be using in my project.
There are some 15 UML diagram types out there. A sensible sequence of diagrams to be created depends on your approach.
If you'd like to create an analysis model that is a conceptual model of your problem domain then a sensible sequence of diagrams might be:
Usecase diagrams
Activity diagrams
Class diagrams
and if your project gets bigger you might need package diagrams.
If you'd like to create a design model that is a conceptual model of your solution domain then a sensible sequence of diagrams might be:
1. Component diagrams
2. Class diagrams
3. Sequence diagrams
4. Statecharts
In both cases a starting point is having a diagram for your system context. Some people like to mix component and usecase diagram features to denote a system context.
The aspects you might want to take into concideration of your diagram choices are:
syntax - how strictly would you like to follow the UML standard and what use does adhering to the standard have for you
semantics - what is your need - what do you want to document - and who needs to understand it
pragmatics - what is the best way to achieve your projects goal e.g. being efficient and effective
tool - what tools do you have at hand and are used and known to your peers - what can you afford to invest in keeping the tool infrastructure up
While your question is very broad, I could imagine that in view of:
My project analyzes the performance of a country in the Olympics based on some attributes.
you'll certainly need a class-diagram. Because the class diagram will clarify what kind of objects your software will manipulate (e.g. Olympic game, Participating countries, Teams, Athletes, Discipline, Competition), how they are related, and what attributes are associated with which each.
This will enable you to determine for the different analysis you want the access path to the relevant attributes. It will also allow you to find missing attributes, and to desing a convenient interface for the different classes.
You may also use other diagrams. But with the few requirements you've shared, it's difficult to guess which one and I do not want to do a lot of guesses. I could nevertheless imagine that a use-case diagram could help to give the big picture of who is going to do what with your software.

Domain model and class diagram

I was wondering if it was possible to have differences between my conceptual model and the class diagram?
In the conceptual model, I explain that the user can create a message.
But in the class diagram the user must go through a class that contains all methods of creating a "ManageMessage" message.
here is an example
Can you help me ? Thank you
It's up to you how you show your classes in different diagrams. So in one you can show detailed attributes and operations and in another you show just the class name. However, in most cases it's better to create domain model which focuses on business aspects in the beginning. It does not have technically imposed structural elements and mainly you use attributes (YMMV). Later you derive a technical design from that model where you create a copy that links back with <<trace>> dependencies (UML tools offer transformation for that). Although you have to (mostly) manually synch the two models it's best to communicate with either business and developers.
N.B. about your design above: A message with zero related users does not seem to make much sense. Also you should not use the shared aggregation since it has no defined semantics.

What is the difference between Conceptual Class Diagram and Detailed Class Diagram?

Can someone briefly explain the difference between a Conceptual Class Diagram and a Detailed Class Diagram?
While a "Conceptual Class Diagram" expresses a conceptual (domain) model, it's not clear what you (or your professor) mean(s) with "Detailed Class Diagram": it could refer to a (language-/platform-independent) design model or to an implementation model like a C++ class model or a Java class model.
See also my answer to this related SO question.
The one-to-many relationships between conceptual models and design models, and between design models and implementation models are illustrated in the following Figure:
As an example that illustrates how the derivation chain from concept via design to implementation works, consider the following model of a people/Person concept/class:
Domain models are solution-independent descriptions of a problem domain produced in the analysis phase of a software engineering project. The term "conceptual model" is often used as a synonym of "domain model". A domain model may include both descriptions of the domain’s state structure (in conceptual information models) and descriptions of its processes (in conceptual process models). They are solution-independent, or ‘computation-independent’, in the sense that they are not concerned with making any system design choices or with other computational issues. Rather, they focus on the perspective and language of the subject matter experts for the domain under consideration.
In the design phase, first a platform-independent design model, as a general computational solution to the given software engineering problem, is developed on the basis of the domain model. The same domain model can potentially be used to produce a number of (even radically) different design models representing different design choices. Then, by taking into consideration a number of implementation issues ranging from architectural styles, nonfunctional quality criteria to be maximized (e.g., performance, adaptability) and target technology platforms, one or more platform-specific implementation models are derived from the design model.
A conceptual class diagram is used to understand and analyze a problem domain. A detailed class diagram is a design artifact, where many things may have been optimized away. For example, every dog might bark, but a dog-salon application doesn't care, so it can optimize away that fact.
I don't know of any standard or methodology that defines both these concepts. For example, the UML specification does not mention them. I think every answer will be subjective. I will give my own answer, based on more than 25 years of experience with IT-related modeling.
In a conceptual class diagram, every class is a concept, usually related to the business domain, the real world, e.g. Customer, Order etc. It may also show concepts that cannot be directly found in the business domain, but are needed to model the functionality of a particular application, e.g. BackupCopy. These are concepts the user of the application must understand. See also www.agilemodeling.com
There are other types of class diagram, e.g. class diagrams that model the source code, where every class corresponds to a Java class or a C# class, or class diagrams that model the physical database structure, where every class corresponds to a database table.
Each of these types of class diagrams may or may not be detailed. If a class diagram is not detailed, it typically does not show any attributes, or only the main attributes. If a class diagram is detailed, it shows all attributes relevant for the problem at hand and the data types of these attributes.
The concept of a conceptual class diagram is e.g. explained by Scott Ambler at http://www.agilemodeling.com/artifacts/classDiagram.htm#ConceptualClassDiagrams.
Basically "Conceptual" here means that the content of the diagram is taken from an analytic view point that takes the "concepts" of a domain and describes them.
For "concept" you could also say:
thing
item
aspect
object
topic
The conceptual diagram is basically what you get if you ask people for what problem they'd like to get solved by your software. So you analyze the situation/problem by asking questions that will help you create you diagram:
what are the things that are relevant? - these will be your candidates for classes
what are the features of those things? - these are the candidates for your attributes
how are the things releated to each other - e.g. is one part of another? Does it need the other? - these are the candidates for your relations
what should you be able to do with these things in your system ? - these are the candidates for your operations
In the past this step was called OOA - object oriented analysis. The steps following this are OOD - object oriented design and OOI - object oriented implementation. Many years ago some authors proposed to create three different models for OOA/OOD and OOI. Therefore you'd have different and usually more detailed diagrams for OOD and OOI. For the term "Detailed Class Diagram" i'd guess that one of the OOD and/or OOI views would be meant. Be careful though - some of the diagrams created this way will have patterns or pattern-like ideas as a basis. You'r diagrams would tend to be very repetitive and redundant if you keep capturing such patterns in concrete diagrams for every conceptual diagram. I'd rather recommend to give just one example of how to go from problem to solution and then comment "do it this way for all other concepts that are similar".

What types of Written Design Documents are used in DDD projects?

1.Which of the following types of written design documents do we normally use on DDD projects:
a. Requirements specifications document
b. Document explaining the the meaning of core elements
c. Document giving the bird's eye view of an application structure
d. Document explaining the meaning behind the terms used by Ubiquitous language
e. Document listing the vocabulary of Ubiquitous language
f. Informal UML diagrams
anything else?
2.Which document types should be created as standalone documents and which should be combined within a single document ( example: document containing diagrams surrounded by text )?
3.And what are Requirements specifications? A list of use cases, a list of tasks program is able to perform or combination of both?
thanks
Consider the following:
A statement of the purpose of your application in 25 words or less
A representation of your model in both code and uml
A list of features corresponding to the current or desired model
A list of constraints (business rules) on the model
Where applicable, a sequence diagram for each feature
A statement of non-functional requirements
An architectural overview for team members (including model boundaries and contexts)
Team instructions and procedures
Note: use cases or user stories can inform your list of features. However, I recommend that a feature be the unit of work.
I recommend that the initial model be created (discovered) in a modeling workshop attended by both domain experts (business) and developers. It must be led by someone proficient in domain modeling.
Business rules are constraints on the model of two types: Property and Collaboration. By way of example, business rules prevent an elevator from moving with the doors open, a perishable item being placed in a non-refrigerated bin, or a cancelled purchase being shipped.
I think Event Storming might be a good solution. A photo of the workshop should be enough. If not you can use the same artifacts into a digital document.

Resources