What difference between reference objects and value objects in UML?

Think of a reference object as being a specific instance with a "life" of its own, that several people may be interested in. For example an Employee, or an Order. If I go and get Employee number 83 and ask for some of its attributes and you do the same thing we would expect to get the same answer, if I change the employee's phone number then you see that change: we are both referring to the same object A value object is something that it makes sense to copy around "by value".

An example Fowler gives is a Date. What's the date of that order? What's the birthday of that employee?

We have a copy of the date, by implication it would be silly to change it. There's no expectation that this value object "knows" it's an employee's birthday - it's just a useful value to pass around.

A reference is an address (pointer) to where the value of the object resides. A value is the actual value the binary representation. If you assign a value you are making a copy of the value into the new variable.

If you assign a reference you are just passing the address of where the value is saved.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions