Question

I have been doing some OO design of late. I also use EF 4.1 as the ORM. Now when i design my classes and their associations, I can think for two approaches. One is for example a Teacher teaches a subject. So Teacher class can have either a reference of the subject object as a property(reference based approach), or it can have SubjectId as a property(ID based approach). I am not sure which approach should be taken and why? I believe ID based approach is more of a relational data approach and reference based approach is true OO approach. But i am not sure.

Was it helpful?

Solution

If you are using JPA choose reference based approach with lazy fetching.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top