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.