It sounds like you are talking about an ORM rather than OOP. What you describe is common behaviour of most ORM systems such as NHibernate, Entity Framework etc.
On Mon, Oct 25, 2010 at 12:38 PM, Rifky Rafeethu <[email protected]> wrote: > hi guys, > > i'm a vb.net developer having a bit experience but new to OOP. i'm having > some doubts such as How to load data to objects using OOP concept when there > is a relationship to another object. i searched in googled and every one is > telling to load the primary object only at initial and load the related > objects when only necessary. > > for example the employee object is related to branch object. each branch > can have many employees but employee can have only one branch. so Employee > object is related to branch object in One to Many relationship. say for > example we load the employee detail, we only load the employee details at > first then if we need to excess the branch only (such as > Employee.Branch.BranchName) we need to load the branch details. > > so my issue is how to load Data into objects using vb.net for the above > example from SQL server database. > > any sample coding will be highly helpful as i couldn't find any proper doc > in the web.. > > waiting for a answer.. > > thanks and regards > Rifky >
