Designing the database to be used in the N-Tier application

I am working on an N-tier application using .NET (C #, SQL Server). I started by developing the database, because I think it would be nice from the very beginning. Now I need your proposals for creating a database to be very flexible. Knowing that the application is intended to be created as a group of plug-ins.

The application is an application for remote control of many different hardware devices (cars, engines, etc.). Here is a snippet of database tables.

  • Device table
  • Staff table
  • User table
  • Role table

As you can see, the device table is a table for representing the devices that we control, and since each device can have more or less properties than others, I want to bind each device to its properties, which can be in another table, it is so elegant , as much as possible. The personal table is intended for people responsible for the device, for example: car drivers (there may be more than one driver for each car), an engine operator, etc.

Users are application users, as you can see that I divided users and roles into two different tables.

What I'm looking for is a way to bind devices to their properties. In addition, in the application, each device is an instance of a connected device. This means that I can connect a device called say: SIM card to a device called Vehicle. Also, are there any design patterns on this?

Thanks in advance, and please forgive me if I do not understand.

+5
source share
3 answers

Depending on how you process your data layer, this database design may be controversial. If you must use EntityFramework with the first approach to the code, you can create your logical entities using this and generate a database from your models.

ORM , , , , , , , , , .

, - , , .

+1

. .

, , . : ? "" ""? ?

, . , "" ""? , : DeviceType PropertyType. , , / . , .

+1

. , .

- , - .

, , . , . , deviceID propertyID. . .

, ( ) .

!

0

All Articles