Best practice: how to insert into multiple tables through the business layer and data layer?

I USED to be a db-time developer and developer, but it has been many years and I retrain ...

I am creating a web application and have a Person table (actually "Profile") with several child tables that have an N: N relationship with my Person table, for example. FavoriteSports Musical Instruments ArtisticSkills

After reading the excellent tutorials on data access at www.asp.net, Scott Mitchell, I want to develop my application with well-designed data access (using table adapters) and business logic (using classes).

Where I hung up, we develop class and table adapters. The “unit of work” here is more like a real object that does not align directly with my table classes or data access objects. Therefore, I assume that I see the need to create a class modeled not around tables, but instead around a real life object (my profile + FavoriteSports + MusicalInstruments + ArtisticSkills).

What I'm really looking for is a good book or website that describes how to do this. In particular, how can I create a class that supports these child records (as collections?). I think I understand the concept - I just need to be guided by how to put it into practice.

The best answer I could ask would point me to a book (C #, preferably) that touches on all this in all its complexities - I'm pretty sure I walked past the Beginners books with that.

Thank -

-Pete

+3
source share
2 answers

Unfortunately, one book may not help. I recommend that you go to these books in order to return to understanding the two worlds of RDBMS and OO. Tables and business objects cannot be a 1: 1 map!

Enterprise Application Architecture Templates

Domain Managed Project: The Problem of Complexity at the Heart of Software

.NET Domain-Driven Design with C #: Problem - Design - Solution

Hope this helps.

+1
source

, , ORM, NHibernate.

- .

, Person Skills:

public class Person
{
   public IList<Skill> Skills { get; set; }
}

" ", , , .

+1

Source: https://habr.com/ru/post/1732267/


All Articles