Class diagram of an Hotel Management System

I am given the following system description :

Consider a hotel
management system to manage a group of 5-stars hotels. If this system is modelled using OOP methodology, and the classes are identified as Hotel, Trip, Room, VIP Room, Regular Room, Suite, Customer, Payment, Cash_Payment, Credit_Debit_Payment, Reservation.

Now I need to draw its UML class diagram, here is my solution :
enter image description here

I have related the customer class indirectly with the Hotel using the reservation class which is related to the Room class and Trip class and both of them are related to the Hotel class is this a valid solution ?. Also, did I miss any composition or Aggregation relationships? Finally, are these multiplicities right? I am just participating in some problems for class diagrams to understand it, so please help me.

software – Could you help me understand what a problem domain is and how can I build my class diagram based on it?

So I just started studying Software Engineering because I am really interested in it and my professor in London asked us to create an app which is like Instagram (only theoretically, without the actual implementation of code) and I would like some help on something.

I have started with writing and studying different parts, like risk analysis and everything and now I just created a class diagram with the classes that are in my opinion essential for the project. Like content, photos, users, display, etc. What I really haven’t understood is that we needed to draw the class diagram based on the problem domain of my case.

Maybe it’s because of my lower English level, but problem sounds literal to me and while some websites mention that the problem domain relates to the risks and the problems of your project, others say that the problem domain is whatever is essential for the creation of the app.

Can someone please elaborate on that? You will really help me get deeper into the project because it’s very confusing and they haven’t explained it so much at uni yet..

Thanks 🙂

dot diagram of jordan form

$dim N(T − λI) = 1, dim N(T − λI)^2 = dim N(T − λI)^3 = 4$
I want to know how to find dot diagram and jordan block of T corresponding to $lambda$.
I know in dot diagram, number of dots contained in the $r_i$ th row is = $dim((N-λI)^{i})$$dim((N-λI)^{i-1})$
But in the particular problem second row has more dots than first row. In that case how the diagram and jordan block will look like.

Modelling java annotations in an UML class diagram

Goal:

I am trying to create a UML class diagram for a java spring application.
Spring uses a lot of annotations and I couldn’t find any resources online on how to properly model them in UML.

I know that there is this question and it gives a good answer on how to model class annotations but it does not talk about method or variable annotations.

Examples:

Example class with annotations:

@RestController
@RequestMapping("/someRoute")
public class BaseController {

  @Autowired
  protected BaseService service;
  
  @GetMapping(BaseEntity.ID_MAPPING)
  public ResponseEntity<BaseEntity> findById(
          @PathVariable(value = BaseEntity.ID) long id
          ) throws ResourceNotFoundException {
      
      BaseEntity entity = service.findById(id);
      return ResponseEntity.ok().body(entity);
      
  }

}

For the class annotations I would use this:

class annotation example

For method and attribute annotations I tried using this:

enter image description here

But as you can see this gets very long and complicated to read very fast.
This also would not work if something had multiple tagged annotations.

Question:

So I would like to know if there is a correct or better way to show annotations in an UML class diagram? Or if java annotations should even be in an UML diagram at all?

uml – Activity Diagram Feedback

I need some consultation on the correctness of the activity diagram, that I have created for the following scene:

I have one dictionary structure, that I want to compare to other dictionaries. for the explanation I want to name it as sentences. So, I am comparing one sentence to other multiple sentences by iterating through them. I am counting the words that match, as bestCount.

Now at first, the very first sentence will be counted as bestDict. then go to the second sentence, and if the bestCount is greater than the previous one, then count the second sentence as bestDict and if not don’t change the bestDict, which means the first sentence should be our bestCount.

In case, if there are multiple sentences, which have the same bestCount, for example if our second sentence was selected as bestDict, where bestCount is 5, and our third dictionary also has, 5 bestCount, then I compare the size of these two sentences and select the bestDict, which has the smallest size.

I am doing this for each one till the end. I have created the following diagram, and need some consultation, regarding the correctness of it, to what I have told in the scene.

Thank You.

enter image description here

uml – Is my Sequence diagram correct? I need some comments

It’s a SEQ diagram designed for a smartwatch app to receive zone level of feeling from an adult with autism on their smartwatch and provide a recommendation based on their input.
The scenario is like this
At one of the pre-configured times or in case of outbursts, the app sends an alert.

  1. Sarah senses the alert and raises her wrist to check the app.

  2. Sarah taps the alert

  3. App displays the question “How are you feeling?”

  4. Sarah choose the zone `angry’ (represented as a red emoji)

6.App displays the level of the zone for her to choose

8.Sarah chooses the level of the zone (it can be green when they feel ok or red when they have some outburst)

9.App recommends her to take a deep breath for 30 seconds

10.Sarah taps on the start button

11.The app will start the countdown

12.The countdown will stop after 30 seconds

13.App displays the message confirming that she successfully finished the session

14.App displays a question: “do you want more 30 seconds”

15.Sarah chooses another 30 second

16.App displays some options like: Take a deep breath, go for a walk,

17.Sarah taps on take a walk

  1. Countdown will start for a 30-second walk

19.Countdown will stop after 30 seconds

  1. App displays a question “Feeling better”? with color code option

21.Sarah taps on I’m okay emoji(Zone)
20.App displays a badge she earned
22.App logs the Zone

I need to know if I need to correct the diagramSequence diagramnot.

design – What is an good way to understand the relationship between a UML class diagram and an implementation?

At my uni the software design teachers like to ask questions about UML diagrams, such as this:

In the following class diagram, can class Bar’s bar() operation modify Bar’s b attribute? Can it modify class Foo’s a attribute?

UML class diagram

Now as far as I know, static operations may only modify a class’s static attributes. Bar’s b is not static. Does this also apply to other classes’ attributes, such as Foo’s a?

But still, how about this?

class Bar {

        public static void bar()
        {
                var bar = new Bar();
                bar.b = something;
        }

}

It seems possible to implement bar() so that in its body it instantiates a Bar object and then modify its non-static attribute. The same could be done with instantiating a Foo and modifying its a.


I know I should differentiate between an example Java implementation and the ‘abstract’ UML diagram, but I can’t help but think of what makes sense and can be implemented while looking at these diagrams.

So what is an intuitive way to think about this? Is there anything that ‘prevents’ me from implementing the code I provided in the diagram?

design – What kind of UML diagram should I make for a large project

My colleagues and I are somewhat in a predicament.
We are interns and trying to figure out what kind of UML diagram we should use to properly display our big and complex project. The project is made in C++, Py, Bash, Java.

The project contains 3 lesser projects

  • A project which lets microcomputers receive radio data and execute said data upon receiving the radio transmissions
  • A project which facilitates the other two lesser projects with the radio data
  • A project which displays the received coordinates from the radio data in an external program

One colleague of mine already made a component diagram for his part. Its expected that all of us eventually make a shared diagram which displays the entire concept…
This is pretty hard for us to wrap our heads around. The project is going fine but documenting it is something else entirely. Hence our question regarding which UML diagram to use!

Thank you for your time and happy holidays!

computational geometry – Bounding the length of an edge in a Voronoi diagram from below

I am stuck at point 2 of the following exercise:

Suppose we have a point set $P$ of n points in the plane. Let $x in P$ and let $y in P$ be its closest neighbour, i.e. $d(x,y) < d(x,p)$ for every other $p in P$.

  1. Show that the regions of $x$ and $y$ in the Voronoi diagram of P share an edge.
  2. Suppose that $d(x,y) = 1$. Show that said edge has length at least $frac{1}{sqrt{3}}$.
  3. Suppose that $d(x,y) = 1$. Show that the Voronoi cell of x has an area of at least $frac{pi}{4}$.

Here is what I have got so far:

  1. Consider the segment $overline{xy}$. (By assumption no other point of $P$ lies on $overline{xy}$.) The points on the line that runs perpendicular through the middle point of $overline{xy}$ are equidistant to both $x$ and $y$. These points form an edge.
  2. I do not see how to prove this. I can only think of the following: With the reasoning we have the following picture (the A should be $x$ and the $B$ should be $y$).enter image description here

I think that now we need some form of trigonometry to get the length of the segment $overline{CD}$, but I do not see how to do this. It might be useful to consider that $overline{CD}$ is bounded by some other cell for another point in $P$, say $z$. By assumption we have $d(x,z) ge 1$. But I do not see how to continue here.

  1. This just follows from the observation that we can insert a circle of radius 1/2 inside the cell of $x$.

Could you give me a hint for point 2?

Software Architecture Diagram for Server-Client (ASP.NET Core, SignalR, Java)

I have Java Desktop Client, ASP.NET Core Server (SignalR for communication) two player real-time game application. There’s no database, no cloud hosting – everything works locally (let’s assume two player LAN), I’m trying to visualize how Client (Java Desktop) and Server (C# ASP.NET Core) exchange data via SignalR while showing the architecture of the software itself).

  1. Java Client – which contains lib folder with: okhttp.jar (http efficiency, multiple requests over one socket connection), signalR.jar (direct server hub method calling and vice versa), gson.jar (JSON serialization & deserialization) and Game.java (Main Client class) – final product: Game.jar.

  2. C# ASP.NET Core Server with: Program.cs, Startup.cs and GameHub.cs (Just primary classes to setup SignalR and add endpoint ‘/gamehub’) files.

(These are the files I see important and think would help me get the point across the fastest when it comes to diagram).

However I’m having trouble understanding how to interpret and visualize certain parts of the software, i’m using this example as a reference:

enter image description here

This is my attempt:

enter image description here

My questions would be:

  1. What stereotype should Client and Server be ? – Device is usually used for physical items which can compute, but can it be applied like this ?
  2. Am I allowed to just use “Node” without stereotype ? (like Hub and SignalR + Pipeline nodes) ?
  3. Is it necessary to put execution environments ? On client side I would add JVM and on the server side – I guess Pipeline + SignalR and then GameHub.cs artifact inside ?
  4. How should communication be visualised ? – Should it be just between devices (because they have all the necessary components inside) or it should be between the components inside devices?

Appreciate any kind of help in advance.