See UML colors here.

Here is the example, I have following entity classes:


MailBox(owner: User, label)

Mail(from: User, to: User, subject, body, composeTime)

MailCopy(type, from: User, to: User, subject, body)

MailDelivery(mailCopy, mailBox)

Use case: Every users have three mailboxes by default: MailBox(*, draft), MailBox(*, received) and MailBox(*, sent). User(alice) composed a new Mail(alice, bob, hello, world), and clicked the "send" button. A new MailCopy(SOURCE, alice, bob, hello, world) is created and delivered to the MailBox(alice, sent), and another copy MailCopy(DEST, alice, bob, hello, world) is created and delivered to the MailBox(bob, received).

I want to know how to classify these entities according to the UML colors archetype?


User can be green or yellow depending on how you look at it (if the User is a system role it's yellow, if it's User as in a person, it's Green).

Mailbox is green...but the owner should be extracted out as a yellow role (which tells me mailbox should be pink -- roles go from a green to a pink...rarely from green to green). Technically the Mailbox is an Account which is definitely a Pink Moment Interval...let's call it an E-Mail Account (the moment is when the account was open so you might want to record that).

Mail is green but it has two pinks associated with it. Sent Mail, and Delivered Mail.

On both Mail Events, the Sender (or From) is yellow, and the Recipient (or To) is also yellow.

Looking closer at your specs, I'm not sure MailCopy is necessary. You have the Mail Object itself, after it's created it should be uneditable so anyone who needs it just points to the same copy.

What you're calling Mailbox, I would call folder which would be green. I would reference the mail to the folder using a pink folder assignment.

Hope this helps.

  • +1 for the great advice. So MailAccount should be pink, and MailFolder should be green, right? Everything in the system could have a created-time, then how do I recognize whose created-time should be a moment-interval? – Xiè Jìléi May 9 '11 at 22:37
  • And, should I make MailOwner, MailSender, MailRecipient as separate entities? It feels like unnecessary, though. – Xiè Jìléi May 9 '11 at 22:42
  • 1
    Sometimes entities can be implied so you don't HAVE to create the separate MailOwner, MailSender, MailRecipient roles. Just be aware that they exist and be ready to extract them when the application needs them. MailFolder is green...the creation of the mailfolder is pink (it could be implied as well). Sometimes following the rules explicitly makes a verbose domain but knowing where you can imply the entities versus needing to extract them is as important as knowing the rules. – Michael Brown May 10 '11 at 0:32
  • 1
    Product as a single, physical, tangible item is green. Product as a description is blue. The difference is subtle. A batch of milk produced on 5/10/2011 with batch number 429 is green. Stackexchange Milk is blue. – Michael Brown May 10 '11 at 14:49
  • 1
    An action is what we look at a pink. So for a dairy farm control application you might have MilkBatchCreation as a pink object. Or if you were controlling a CPU factory you would have i7Q750 as a blue and CPU with id 12345 as green (with the i7Q750 blue descriptor attached), and CpuCertification as a Pink (having a certified date). BTW in case you don't have it, Java Modeling in Color with UML is a great reference for all of this amazon.com/Java-Modeling-Color-UML-Enterprise/dp/013011510X – Michael Brown May 10 '11 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.