Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
+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
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
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
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 – Michael Brown May 10 '11 at 14:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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