简体   繁体   English

在继承的N层应用程序中寻找答案

[英]Looking for answers in an inherited N-Tier Application

I have inherited an n-tier application and I would like some explanation of its way of grouping files. 我继承了一个n层应用程序,我想对它的文件分组方式进行一些说明。

I guess BAL is the BUSINESS ACCESS LAYER DAL is the DATA ACCESS LAYER 我猜BAL是业务访问层DAL是数据访问层

Any guesses for EAL? 对EAL有任何猜测吗? Anyone have any idea what EAL is? 任何人都知道EAL是什么吗?

Also, why would the file name content in the BAL be the same as the DAL? 另外,为什么BAL中的文件名内容与DAL相同? 在此处输入图片说明

EAL - Probably Entity Access Layer - Although I wouldn't name it like that. EAL-可能是实体访问层-尽管我不会这样命名。 It's simply the Entity Framework Model and a related SQL file in your situation. 它只是您所处情况下的实体框架模型和相关的SQL文件。 Rather than name that folder EAL, I would just call it Model or Database or Data 与其将文件夹命名为EAL,不如将其命名为ModelDatabaseData

As for why there is a BAL and DAL with same filenames, I bet if you compare each file 1 by 1, you will see some differences, in terms of properties, fields etc etc. 至于为什么会有一个BALDAL具有相同的文件名,我敢打赌,如果您将每个文件一一比较,就会发现在属性,字段等方面有些差异。

The DAL maps 1 to 1 to the database table / entity field names, while the BAL might contain extra fields and methods that are used either in the UI, or for intermediate processing (ex: to do calculations based on certain other values) in addition to the fields required in the DAL . DAL将1到1映射到数据库表/实体字段名称,而BAL可能还包含用于UI或用于中间处理(例如:基于某些其他值进行计算)的其他字段和方法。到DAL中要求的字段。

Example: Contract.cs in DAL might simply have all the required database fields, like BidStartDate , BidEndingDate etc, while you might have an additional field called DaysRemainingForBids in the BAL that you display in the UI, and that is calculated as the difference between current day and the BidEndingDate . 示例:DAL中的Contract.cs可能仅具有所有必需的数据库字段,例如BidStartDateBidEndingDate等,而您可能在UI中显示的BAL中有一个名为DaysRemainingForBids的附加字段,该字段的计算方式为current day值之间的差current dayBidEndingDate

In other words, properties and methods that are not needed in the database, but are required for business logic and UI display, entry will be in the BAL and not in DAL for the same entity. 换句话说,数据库中不需要但业务逻辑和UI显示必需的属性和方法,对于同一实体,条目将在BAL中而不在DAL中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM