what makes an Value object?

E

Elhanan

hi..

i have an entity class (which is a many to many class) which has
several fields which to me could be in a different object linked by a
one getter and setter.

this class is called RequestPlan and has one person and one policy

it also have InsuranceCode,Insurance Type and several others fields,
which could be in a differnet class as a value object becouse they
represent the product itself, essetially this class wil contain data
about the products and how they are used under the context of the
current policy and person.


what do you think?
 
D

Daniel Pitts

Elhanan said:
hi..

i have an entity class (which is a many to many class) which has
several fields which to me could be in a different object linked by a
one getter and setter.

this class is called RequestPlan and has one person and one policy

it also have InsuranceCode,Insurance Type and several others fields,
which could be in a differnet class as a value object becouse they
represent the product itself, essetially this class wil contain data
about the products and how they are used under the context of the
current policy and person.


what do you think?

If it simplifies your code, and satisfies your requirements, I say go
for it.

By simplify, I mean makes it easier to understand. Keep in mind that
you can always refactor if your current design ends up not being good
enough.
 
E

Elhanan

the entire model may simplfy my code, however it does not simply the
process with fills it with data from legacy code.
my model should be saved in a database with hibernate, with many to
many relations, and since the erd does allow duplicate records i won't
allow duplicate instances of entities in my model.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,259
Messages
2,571,295
Members
47,931
Latest member
alibsskamoSeAve

Latest Threads

Top