Efficiency on representing a class in the UML- class diagram for only one instance.

StackOverflow https://stackoverflow.com/questions/19708263

  •  02-07-2022
  •  | 
  •  

Question

I would like to ask you about the efficiency on representing a class in the class diagram for only one instance. You see in the problem statement, it was mentioned that there is only a single administrator account. and this account allows an administrator to obtain statistical information...etc).

and of course, this featuer will be representing in the use case diagram.So in the mapping it will be new class for admin unde the user class. and what can restrict the account to be only one ? (Ex. method or attribute)?

Maybe it is a trivial question but I just don't see why i will create a new class for only One instance !

Thank you in advance.

Était-ce utile?

La solution

for me it does not matter how much instance you will have. You could ask the same with 2 or 3 instances... The question is do you need it maybe you can use a different pattern? But you need it you have to create it, that's all. In Java for example classes having a unique instance (static classes) are used a lot.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top