Windows DNA 2 business logic layer

Source: Internet
Author: User

The most important and fundamental part of Windows DNA is the Framework Guidance for business logic layer design, while com is the core concept of Framework guidance. COM technology has been around for a long time. It is a product of Microsoft's component-based design philosophy. It promotes component-based development and object-oriented programming, promotes code reuse at the binary level, and provides necessary mechanisms for communication between COM components. If you want to have a comprehensive understanding of the COM technology, there are many books for reference, such as the com essence, the COM technology insider, And the ATL technology insider.

Windows DNA aims to provide framework guidance for network application systems. When it comes to networks, we will inevitably think of distributed processing. How to remotely call the COM component running locally or outside the process is a problem solved by Windows DNA. Microsoft's solution is DCOM, that is, Distributed COM. DCOM is based on RPC, and its function is to serialize the client method call and then pass it to the server. If there is a return value, the server serializes the call result and returns it to the client. However, we know that the general problems of network application systems include concurrency, transactions, and security. Microsoft's job is to make their developers focus more on the business rather than the technology. .

Microsoft needs a mechanism to achieve their goals. This is COM +. We can think that COM + is a group of services. It not only implements remote calls of components in the process, but also attaches services such as concurrency, transactions, security, and asynchronous calls. If you have compiled the COM + component, you can understand that Microsoft has done a lot of work in this aspect, in this way, you can access the transaction context, security context, and build parameters in the COM + object you write. At the same time, you do not need to do too much work for program concurrency. All you have to do is consider what transaction support your COM + object requires, what security policies you need, and what configurable parameters you need, note that your COM + component should be stateless, because Windows DNA requires that your architecture be scalable, one of the biggest features of a scalable architecture is stateless, so that the system can be horizontally scalable. Microsoft has also done a lot of work for the installation and deployment of COM + components.

COM + is a set of services, including queue services and distributed transaction processing. If you mark your COM + object as a queue, each call to the COM + object will be placed in a specific windows queue, and reliable remote method calls will be achieved through the MSMQ Service. If you mark your COM + object as a transaction or request a new transaction, you can obtain the transaction context in your COM + object and perform transaction operations, for example, if you discard or commit a transaction, the underlying COM + implements two-phase transaction processing through MTS, resource processor, and other components to ensure that your business is processed effectively and correctly.

All in all, when considering the design of the business logic layer, we should give priority to the COM + technology, and consider what transaction support and security policies the business logic needs, in addition, you need to make your COM + object configurable and achieve horizontal scalability at the business layer through stateless logic.

Related Article

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.