Analysis of data access layer technology under. Net (v)

Source: Internet
Author: User
Tags definition constructor implement advantage
Access | data Øborland ECO

The Borland company, renowned for providing "fastest" components, pioneered a new development framework before Microsoft released ObjectSpaces: ECO (Enterprise Core Object), without saying its technical features, On the basis of its seamless integration with modeling tools together, we have to admire Borland's effort in unifying the development process.



According to Borland's definition in the eco introduction, simply put, ECO is: Model-driven (Mda-driven)-based. NET database application (the database application) Development Framework (framework).

(Viewpoint: In the author's opinion, the core problem of database application is DAL, which is the topic that this article needs to discuss)



Clearly, it is easy to see from the Mda-driven,database application and frmework that these are the most powerful core competencies of Borland companies (including, of course, the IDE, components, Cross platform and so on, a company can have so many excellent products, it is very respectable!

Previously, the development of database applications on the Borland platform has been very convenient, component + visual design can basically get a relatively simple application module. Now more on the floor, and finally launched their own O/R mapping Solution!

To the author's point of view, in together such excellent modeling tools to join, with the framework of the development of a single strength (only in the artistry, the VCL framework can take the field of the Academy Award), the current eco-absolute steady sitting. NET O/R Mapping the first place!

(Note: ObjectSpaces has not yet been published, temporarily does not consider.) )



On eco-specific development of the introduction, you can refer to "programmers, 2003.12,p99," "Programmer, 2004.01,p97", "Programmer, 2004.02,p100."



The following, the author mainly analyzes the use of eco-development brought about by the advantages and disadvantages, for your reference.



Advantages:

(1) compared with the typed dataset (the typed dataset, which can be generated automatically in vs.net), it has a distinct advantage; In addition to being able to uml/

Free switch between code, ECO can support custom data types

And the type of calculation (the friend who used Delphi knows it's an anomaly.

Powerful weapon);



(2) The IDE provides powerful design-time support, all kinds of tools, components readily available, which is also borland the most adept at the field;



(3) Integrated together modeling tool, the MDA to play incisively and vividly; this is the 3rd place, please refer to the following shortcomings analysis;



(4) The introduction of Object Constraints Language (OCL), which is officially supported by the OMG organization, known as OO sql (object-oriented sql), is a great boon for developers unfamiliar with SQL;



Disadvantages:

(1) The resource consumption is big, the ordinary machine is difficult to realize its superiority; In this respect, Rational Xde did quite well;



(2) A certain learning curve, such as: OCL (Object Constraints Language), although different from the SQL, but from a grammatical point of view is not very concise; on the author's own experience, It may be easier to learn about XQuery (the query Language in XML) or Opath (the query language used in objectspaces);



(3) Pure commercial products, only the architect version contains this functionality, and ObjectSpaces is directly included in the. NET Framework, independent of the vs.net version, and can be used directly through the. NET Framework SDK;



(4) Slight over Mda:dal developers can generate database scripts in Eco, does the DBA also need to design in eco?

For enterprise-class applications, the author thinks: MDA development model is more suitable for the development of the above dal, such as: System architecture,business façade,business Logic, even user Interface, For data Storage, MDA intervention may not be very important.

Imagine that the O/R mapping provides a mapping relationship, which is to separate the RDBMS from the other layers, and if all is done in one place now, wouldn't it add to the developer's burden (sometimes the more automation is not the better)?

Another point: Eco claims that "code/UML bidirectional Synchronization" does not guarantee "code/fields can be different", which in some ways loses flexibility!

(Hint: UML "Synchronization" means that the design is "consistent" with the code framework, but in the O/R mapping, instead of requiring this "consistent", only need to establish a corresponding relationship between the Dal and schema can be, and borland the idea of traditional modeling to the DAL design, The author thinks it is debatable. In this respect, other O/R Mapping Scheme is more natural, highlighting the meaning of "Mapping", rather than simply "synchronization". )



Ø Other

There are other technologies can also implement O/R mapping or similar functions, in the author tried to some of the solutions, constructor (foreign), Grove (domestic) are a good choice, constructor even known as "Model driven RAD For. NET, interested friends can visit the following sites:

Http://www.dotnetbuilders.com

Http://grove.911link.com



Said a lot, again to "sum up" time, the author again boldly suggested:

(1) and based on the ado.net of the DAL implementation mode, O/R mapping has a huge

Advantage, but also hides the risk:



n the most serious problem is the conflict with the stored procedure!

As we all know, the essence of O/R mapping is mapping, in this respect various implementations

Has its strict definition, plainly speaking, is the conversion of table operations to object operations.

But the flexibility of the stored procedure (incoming parameters, return results, etc.) has to make

It is temporarily excluded from the O/R mapping family (at least at present, on

The described OJB, objectspaces and other schemes do not support stored procedures);

On the other hand, if we want to implement more complex data logic, we don't

Not to write the original with the new object Language (such as OCL, OQL, etc.)

A complex SQL statement that can be encapsulated in a stored procedure. And, even if you write

These data logic can also make it feel very strange and even ugly (some kind of

Meaning, this also violates the original intention of o ' mapping!



n the second problem is: in the O/R mapping environment, the system will have a certain loss of efficiency, even if the cache Management (one-time load configuration file) or delayed Loading (also known as Lazy Loading, True connection to database only when accessing entity class data, because the reflection mechanism is used to locate entity classes in the initial loading of data (in some scenarios, mapping relationships are reflected in. NET attributes, which takes more time), So it would be better to fill the data directly through the ado.net, so quickly!



If you think the above risks are not a problem, then the following is the author's real

Suggested.



(2) in the development of large applications (commonly referred to as enterprise applications), Eco is a good

Select



(3) If it is ordinary n-tier application, then objectspaces enough;



(4) Want to learn o ' mapping friends, can look at the OPF/OJB source code,

The implementation ideas of these two schemes are similar to eco/objectspaces;



(5) If you do not want to use the ready-made O/R Mapping, you can opf/ojb the base

On-demand reduction, or refer to the following "design their own persistence layer" proposed in the proposal.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.