Using a "vo" for joined data?
Posted
by keithjgrant
on Stack Overflow
See other posts from Stack Overflow
or by keithjgrant
Published on 2010-04-07T18:49:11Z
Indexed on
2010/04/07
18:53 UTC
Read the original article
Hit count: 284
I'm building a small financial system. Because of double-entry accounting, transactions always come in batches of two or more, so I've got a batch
table and a transaction
table. (The transaction table has batch_id
, account_id
, and amount
fields, and shared data like date
and description
are relegated to the batch
table).
I've been using basic vo-type models for each table so far. Because of this table structure structure, though, transactions will almost always be selected with a join on the batch
table.
So should I take the selected records and splice them into two separate vo objects, or should I create a "shared" vo that contains both batch and transaction data?
There are a few cases in which batch
records and/or transaction
records. Are there possible pitfalls down the road if I have "overlapping" vo classes?
© Stack Overflow or respective owner