Book a Demo

Author Topic: Class Diagram HELP!  (Read 5706 times)

bilhemina

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Class Diagram HELP!
« on: April 06, 2008, 05:55:27 pm »
Hi guys,

I have a case that I need to model using a class diagram, but as I am a complete and utter beginner I'm really stumped as to how to begin this. If anyone could help me out in regards to identifying classes and possible attributes it would be much appreciated.

The case is:

A web design company, called Webmedia, is organised in 4 departments: the HR (Human Resources), the Graphic Designers, the Developers and the Managers. Each employee may work in one or two Departments and is under the supervision of only one manager.

Additional important information to be recorded for each employee includes the name, surname and age as well as the paid leave allowance per year (number of paid days the employee can take as leave).

An employee can request leave. There are 3 different types of leave that can be requested: holiday leave, sick leave or unpaid leave. Holiday leave is paid at the rate the employee usually earns, while all sick leaves are paid at a fixed rate of $50 per day. All leaves need to be signed off by the employee's manager before they can be processed by HR.

I'm not really sure how to identify what aspects should be classes and how they should all be linked together.

Thanks in advance!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Class Diagram HELP!
« Reply #1 on: April 06, 2008, 09:29:04 pm »
Hey there,


Are you sure this isn't an assignment from OOD 101? It certainly reads like one. If it is, this is a forum for professional software engineers using a specific tool and you really should be doing your own homework.  ;)

If not, I think you're attacking the problem from the wrong angle. If you're discussing terms like employees, pay and leave requests, you're looking at business process modelling, not class modelling.
There's quite a few steps between analysing the problem domain and designing the implementation-level entities, and the set of classes you eventually end up with bear little resemblance to the real-world (domain) entities.


/Uffe
My theories are always correct, just apply them to the right reality.

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Class Diagram HELP!
« Reply #2 on: April 07, 2008, 09:55:19 pm »
Quote
Hey there,


Are you sure this isn't an assignment from OOD 101? It certainly reads like one. If it is, this is a forum for professional software engineers using a specific tool and you really should be doing your own homework.  ;)


Errm, well I do not agree, because this would show some sort of attitude- one side the(dumb) beginner and the great and good professionals, untouchable and unquestionable, on the other.

I really don´t think we want it that way as some day we were all beginners and greatful for any help we could get.

Quote
If not, I think you're attacking the problem from the wrong angle.

The angle is correct, however he missed a few steps in between.

First what is given is the textual representation of a global UseCase (business/problem domain) with some actors (HR, designers, developers) which are belonging to a group called employees.

Now what is necessary is to extract the detailed use cases from this general UC and relate it to each others, the actors involved, showing input and output states and conditions, exceptional cases, etc.
Enrich it with UCs which are not so obvious (parameterisation, GUI, configuration, etc.) as well as system boundaries (what is in your system, what is external)

Model it with use case and activity diagrams, it is also convenientn to document structural requirements in class diagrams in that stage (of business objects, not software classes).

Remember: This is still on the problem domain side, no technology.

The difficult part: The transition into the technical aspects.
The same use cases have to be transformed into technical (system) use cases by eg. considering processing of data. Eg. if an actor is processing some data or if it is processed itself it will propably be some sort of technical object (class, component, structure, whatever).

You can go on that way and model system use cases, their relationships, components, classes and activities on a system level.

This is a rather rough description. The whole story is more complicated.
Again, I recommend "Applying UML and patterns" by Craig Larman which gives detailed steps of eg. critierias how to identify classes and objects from use cases.
I believe for your purpose it is the book of choice.

Regards.

Oliver

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Class Diagram HELP!
« Reply #3 on: April 08, 2008, 09:25:30 am »
Quote
Are you sure this isn't an assignment from OOD 101? It certainly reads like one. If it is, this is a forum for professional software engineers using a specific tool and you really should be doing your own homework.  ;)
My opinion is that homework questions aren't off topic for the "UML Process" board, but I really don't blame you for not feeling motivated to help the original poster - they haven't shown any evidence that they have put any of their own effort into the problem. If they had listed what they thought might be classes and asked whether they were heading in the right direction or not, they would have helped their cause.
« Last Edit: April 08, 2008, 09:28:07 am by KP »
The Sparx Team
[email protected]