473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

uml-modelling, inheritance of interface?

10
Hi all,

I have a scenario like that,

Engine Driver
  • Captain : The Engine Drivers who reach “Enough Track Experience” and “Enough Year of Employee”. “Enough” terms can be changed in time. It must be flexible.
  • Assistant Captain : The Engine Drivers who can not be captain yet.
  • Certified Engine Drivers : The Engine Drivers who has a certification to operate High Speed Train. Either a Captain or an Assistant Captain is able to be a Certified Engine Drivers.
I want to show this relations using class diagram. But I couldn't figure out how "track experience" and "year of employee" variables can be flexible. "Certified Engine Drivers" is another problem, because both captains and assistan captains can be a certified engine driver, so it sounds like a type conversion is needed? Thanks in advance..
Nov 17 '10 #1
1 1364
Joseph Martell
198 Expert 128KB
why would you like to use inheritance for these relationships? Unless there is something substantive changing from one type of driver to the next, inheritance will be overkill. You could use properties to represent these aspects of a driver instead of inheritance:
Expand|Select|Wrap|Line Numbers
  1.  
  2. enum EngineDriverRank
  3. {
  4.     Captain, AssistantCaptain
  5. }
  6.  
  7. class EngineDriver
  8. {
  9.     public void PromoteDriver()
  10.     {
  11.         //check promotion requirements
  12.         //if enough experience _rank = Captain
  13.     }
  14.  
  15.     private EngineDriverRank _rank;
  16.     public EngineDriverRank Rank
  17.     {
  18.         get
  19.         {
  20.             return _rank;
  21.         }
  22.     }
  23.     public bool Certified
  24.     {
  25.         get;
  26.         set;
  27.     }
  28. }
Nov 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Hugh Cowan | last post by:
Hello, I don't program full-time (anymore), but I do try and stay on-top of the latest technologies and like most are always trying to upgrade my skills and remain current (as much as is...
33
by: Nick Evans | last post by:
Hello there, I have been on and off learning to code (with python being the second language I have worked on after a bit of BASIC). What I really want to know is, if you are going to actually...
9
by: Maurice LING | last post by:
Hi, Is there any UML tools that is able to take UML and generate Python codes? Cheers Maurice
3
by: John Gabriele | last post by:
Can anyone please point me to a good UML tutorial that contains C++ example code? The stuff I've found on the web and on the bookstore shelves doesn't contain any actual C++ code. Googling, so far...
3
by: Jim Douglas | last post by:
Can anyone point me, and probably others, to some type of tutorial of UML that would include a real world application. I have been reading and trying to put it all together but there is sooo much...
4
by: Eduardo Bezerra | last post by:
Hi, Is there a convention to represent a class template in a UML class diagram ? Best regards, Eduardo
5
by: Jeff Louie | last post by:
I have finished creating graphical views (UML) of the most basic C# OOP concepts. Enjoy! http://www.geocities.com/jeff_louie/OOP/oop12.htm Regards, Jeff <<comments appreciated>> {helpful,...
2
by: mary | last post by:
Hi, for my thesis at the university I'm working on a Visual c++ 6.0 source code, to understand better it I need to extract the UML graphics: Class Diagram, Object Diagram, Use Case Diagram, State...
6
by: Anastasios Hatzis | last post by:
Hello, I'm working on the light-weight MDA tool pyswarm, http://pyswarm.sourceforge.net/ (it is about a code-generator for Python/PostgreSQL-based software. I plan to add support of UML CASE...
24
by: not_a_commie | last post by:
If you were going to hire a software architect / functional lead for your project (written exclusively in C# including WPF, WCF) would you require that they have UML skills? Is being able to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.