I am using an entity data model for linked tables. Depending on the size of your database, I would create only one model if there were less than 20 or 25 tables. It's a little expensive to create separate models for each table, since each model has an EntityConnection object to be created.
I find that I can support models well if I have 5 to 15 tables. The main deciding factor is functionality. I am building engineering applications, for example, I have about 6 tables of structural steel components. All of them are in one model. They have common engineering attributes, so itβs easier to reuse code specific to managing these attributes.
This means that I can create an instance of the model, create objects, manage these objects in a common code file. Any changes that need to be transferred back to the database can be made quite efficiently.
The bottom line defines your need and frequency of use for basic objects. If you are going to constantly update one or two tables, then it makes no sense to have 30 other unrelated tables inside this model. In this case, when a small number of tables are often used, it may make sense to create collections of these objects, manage collections, and update the database at the appropriate time.
Maipulation memory is much cheaper than performing I / O. This is just my view of the framework, and by no means am I an expert in this.
source share