J
John_Woo
Hi,
if I want to reflect a 1:1 relationship for user:account, the design
model may be:
for class:
A. User
-------------
int user_id;
int account_id;
B. User
------------
int user_id;
Account account;
for db:
C. User (user_id int); Account(account_id int, user_id int)
D. User (user_id int, account_id int); Account (account_id int)
Questions:
1. How to compare A vs. B in terms of OO design, JDO (java data object)
2. How to compare A vs. B in terms of db schema (with foreign key
constraint)
3. C vs. D, which is better? should create user first or account first?
if I want to reflect a 1:1 relationship for user:account, the design
model may be:
for class:
A. User
-------------
int user_id;
int account_id;
B. User
------------
int user_id;
Account account;
for db:
C. User (user_id int); Account(account_id int, user_id int)
D. User (user_id int, account_id int); Account (account_id int)
Questions:
1. How to compare A vs. B in terms of OO design, JDO (java data object)
2. How to compare A vs. B in terms of db schema (with foreign key
constraint)
3. C vs. D, which is better? should create user first or account first?