In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the WCF models?". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Monotonous and singleton patterns reflect two extreme ways of activating remote objects, while CAO is a relative compromise: a client proxy object matches a remote object one by one. The WCF instance context mode is similar to the remote object activation mode of .NET Remoting, and also has three different instance context modes, which match the above three activation modes. The three instance context modes are: Per- Call mode, Per-Session mode and Single mode.
1. Monotone (Per-Call) mode
Monotonous (Per-Call) mode. Net Remoting SingleCall remote object activation mode. If the monotonous instance context pattern is adopted, for each service call, whether it comes from the same client (service proxy) or a different client, the WCF pattern always creates a new service instance and instance context object to handle the service invocation request. After the execution of the service operation, the instance context object and the encapsulated service instance are recycled. The figure reveals the relationship between instance context, service instance, and service broker in monotonous mode.
The relationship between service agent and service instance context in monotonous mode of figure
2. Session (Per-Session) mode
The purpose of a Session is to maintain the state between multiple service invocations from the same client (that is, the same service proxy). From the perspective of message interaction, multiple messages from the same client can be associated together through a session. In the session instance context mode, WCF assigns a separate service instance context object to each service proxy object, and all service invocation requests from the same service proxy are distributed to the same service instance context processing. The session mode is similar to the CAO remote object activation WCF pattern under .NET Remoting, and figure 3 reveals the relationship between instance context, service instance, and service proxy in session mode.
The association between service proxy and service instance context in mode
3. Single mode
The singleton pattern means that WCF maintains one for each service and only one service instance context. Whether the request comes from the same service proxy or a different service proxy, the service invocation request is handled by the same service instance context object. Singleton mode is equivalent to Singleton remote object activation under. NET Remoting. Figure 4 reveals the relationship between instance context, service instance, and service proxy under singleton mode.
The relationship between service agent and service instance context in session mode
This is the end of the content of "what are the WCF modes"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.