Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have problem with multiple references to the same object in model layer.
Let's say I have two tables :
ADDRESS_TABLE(
ADDRESS_KEY,
SOME_COL1
)
TRANSACTION_TABLE (
SHIPPING_ADDRESS_KEY,
PAYMENT_ADDRESS_KEY,
SOME_COL1.
SOME_COL1
)
To set proper relation between tables I'm forced to create two dynamic tables from address.
SH_ADDRESS_TABLE(
ADDRESS_KEY AS SHIPPING_ADDRESS_KEY,
SOME_COL1 AS SH_SOME_COL1
).
/* retrieved from RESIDENT ... */
PAY_ADDRESS_TABLE(
ADDRESS_KEY AS PAYMENT_ADDRESS_KEY,
SOME_COL1 AS PAY_SOME_COL1
).
is there any smarter way to do that? Do we really create copy of data or we are referring to the same physical place in memory?
Regeards.
I think you're model is correct.
The address table has 2 roles, shipping and payment.
2 roles, 2 tables.
You can read here