instancecontextmode - How to avoid unnecessary objects getting initialized WCF -


We have been exposed to a number of operations with a WCF service in which basic Acteepibeeding and service implementation something like this < / p>

  public Class Maissev (private IHandler1 _handler1 = GetHandler1 (); private IHandler2 _handler1 = GetHandler12 (); private IHandler3 _handler1 = GetHandler3 (); public void handle message (string msg) {_handler1.SomeMethod ( );} Public Zero Handle Message (String msg) {_handler1.SomeMethod ();} Public Zero Handle Message 2 (String msg) {_hand ler2.SomeMethod ();} public void handle message 2 (string msg) {_handler3.SomeMethod ();}} is  

But with this code I see that started all Handler are the handler 1/2/3 while we receive a request to handle the message, then I mean the client calls Handlmasesej (2) method should be Aantikrit only handler _ Hॅndlr 2.

< P> Since the service is exposing the end point with basic hotpibing, which Session does not support InstanceContextMode PerCall that will create all the handlers, when the client does not have to request an event.

Maybe I am misunderstood, but why do not they be necessary in those ways? After your implementation would look something like this:

  public class Maiswive (public void handle message (string msg) {IHandler1 _handler = GetHandler1 (); _handler.SomeMethod ();} public void handle Message2 (String msg) {IHandler2 _handler = GetHandler (); _handler.SomeMethod ();} Public Zero Handle Message 3 (String msg) {IHandler3 _handler = GetHandler3 (); _handler.SomeMethod ();}}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -