How to design three-layer structure data layer

xiaoxiao2021-03-06  31

I want to design the system according to the three-layer structure, but the bitter is not known to design.

After reading a lot of information, Microsoft's requirements are not status, and the inter-layer is transmitted, while J2EE seems to be required, and the interlayer is delivered.

Who has the design experience, please advise! !

Everyone has the same confusion, but I think the way to use the object may be better because:

1. Database from relational to object-type development is trend

2, Microsoft provides DataSet in .NET Framework, Microsoft provides data on multiple heterogeneous objects, simply, is a DataSet can be loaded with multiple RESULTSET (JAVA). However, it does not mean that Microsoft is in contact with the object. In fact, many engineering design is the idea of ​​using objects, even if it is .NET Framework

3, use object biography may make the code's maintenanceability better

4, now in the Ormapping area, some companies have a mature practice, such as China's Kingdee (their own words, I don't know if it is true). I think this concept should be downtown.

5. When I design, I have never considered the transfer of data sets, or it may be that my practice is too single, or there is a mistake, you may wish to correct.

The above is discussed with you, I hope to get your correct, everyone will make progress together.

Thank you for your answer! 1. I also think that the use of objects can be more maintenanceability, but the use of records will be higher. Because one object is pressed according to each table, the efficiency is difficult to avoid, but a SQL statement with a recordset can return multiple tables. 2. I see the method used in Duwamish's enterprise example duwamish is to contain data with DataSet, but do not use one object to correspond to each table, each attribute corresponding field; and all CRUD operations are stored procedures I don't think so. Total, make progress with you

I have not studied the example in .NET Framework, it may be Microsoft to have his considerations, but I don't understand the benefits. On the other hand, I think it is not much like you, everyone exchanges. First, the tables and objects do not have a strict one-on-one relationship, not a table corresponding to an object, although most of the time is like this, but will have some special design, such as transactions, such as transaction, according to specific logic ... How much is the efficiency of the object with a recordset. Although the use of objects seems to be more than the interaction of the database, the efficiency will decrease. In fact, more is more understanding and implementation of the sensing object mode than the data set, but the actual low-level data operation is the same, but the expression is different. Object mode If the problem is processed, the efficiency will not be much slower than the data set. Finally, if the peak access involved in the system is not large, the weight of the efficiency is much lower than the maintenanceability. After all, the development of hardware is higher than that of software, and the cost of regeneration is lower than the modification software. I don't know how you think about it.

I wrote my own ideas and discussed everyone. 1. I think the problem is to be discussed. I don't want to be bullish. I am scratcy. I am squatting. I am squatting. 菔     技 技  涫 彩 螅琋 螅琋 t Dataset, J2EE Equivalents are all enclosed in RESULTSET and ROWSET. 2. In J2EE, the difference between the records object and the entity object is that the record set object is generic, and the data taken in different table structures can be operated, and the entity object is substantially corresponding to a specific table structure, and can be used for generic aspects. The improvement in versatility is very limited. 3. I mainly use record set objects when designing. It feels so that the structure of the specific structure is not used, the system is relatively simple, and when the surface structure is adjusted, the system-related part is basically no change, and the subsequent adjustment of the table structure is difficult to avoid during development. Some ideas, I want to discuss upstairs: 1) Data use DataSet / ResultSet to deliver data in the development process, it will be packaged into parameters, but if analyzing, develop, maintenance, upgrade Process chain is in this way is dangerous. In this way, the control layer, and even the design of the show must be clearly installed in the black box. If the data layer does not complete the package, it is difficult to do the interface-oriented programming, actually programming or Data-oriented. The development phase saves things, afterwards, the expansion, still go to understand the data table structure, if it is not the same group (a) person before and after, the people will not be willing to face this situation. I think that the data layer will be packaged as much as possible to the database, it is full of logic when it is transmitted to the control layer (of course, not absolute), the control layer is a set, the data layer is transmitted, and then "in Inside, find yourself! ". The DataSet is passed to the control layer, the less better it is recommended. 2) May not agree on the floor, may wish to discuss, welcome my mistake.

If the content of the business is more complicated, it is necessary to define business entity objects, as well as data rules. The exit parameters of the data access layer are business entity objects, which can be used for business layers. Data Access layer import Not directly open to the business layer, but only the data rules on the data rules, business label / modify the transaction, using the data rule layer to open the business entity object.

Compare the data layer according to the business object. I am learning the architecture system, but unfortunately, Microsoft provides the structure I have seen the EJB in J2EE is to divide the data layer according to the business object, which is the entity bean and session bean. I want to imitate in NET, transfer in the data layer abstract business entity, layer and interlayer service entity. I always want to find such examples, the master has such design experience and design ideas, please advise!

I used C # to design a system for Shenzhen a trading company, and I would like to describe it. Everyone will discuss whether there is any place. The system is divided into internal systems and external (web pages), the focus is the internal system, use the Application written by C #, in the design, using the MVC thinking, 80% of the layers are object mode, in the design, the business layer does not directly face For data layers, even call the object layer is not directly, it is performed by an interface that is abstract on the object layer. This design has played a good effect in the later stage of development, and each USE CASE implements Almost similar, programmers look at their own code, knowing others' program structure, very neat (all analyzing design, of course neat), is easy to integrate. This design has a risk. If the object's package class has not been strictly tested, the effect is the opposite, it may spend more time, this, my method uses the sacrifice method to ensure quality, I don't know you There is a good way to operate. In addition, the way the object is used to discharge the programmer from the field, which can save time. When your shared object reaches a certain number, this effect is particularly obvious. If you use .NET design, you must handle the connection of Connection, try to share the synchronous-related objects to share the handle, do not let each object create one, or n objects are shared, this is the lesson I have learned. Even if it is an object set, I don't think of the result set, you can encapsulate the results in Hash, Map, Vector, etc., pass. I think it is not worth it because of the complexity of logic, but most of the programmers like this practice because it can save trouble. I don't know if I insist on it? In addition, there is a question asked the brothers of the shop. Are you a Jindie's speaker (^ _ ^, joke) Good "?

Yes, I also think that use hash, vector and other packages, but use RS can save, I will save another, I am not a whisper of Kingdee, I have seen the demonstration, I haven't actually used it, the impression is very deep. Of course, it feels only a single object's mapping. The object hierarchy may not be, to tell the truth, with their BOS framework, development or save a lot. Look for a chance to use it. Author: linchangping posted from: www.umlchina.com

转载请注明原文地址:https://www.9cbs.com/read-76792.html

New Post(0)