I found myself responsible for developing a system that I did not initially develop, and I can not ask the original designers why some design decisions were made, since they are no longer there. I am a junior design developer, so I did not know what to ask when I started the project, which was my first SOA / WCF project.
The system has 7 WCF services, will grow to 9, each of which will be placed in a separate console application / window service. All of them are single and single-threaded. All services have the same OperationContract: they set the Register () and Send () methods. When client services want to connect to another service, they first call Register (), and then, if successful, they perform all their communication with Send (). We have a DataContract that has a MessageType and Content propety enumeration that may contain other useful DataContract data. What the service does with the message is determined by the MessageType enumeration ... everything comes through the Send () method and then goes to the switch statement ... I suspect this is unusual
Register () and Send () are actually OneWay and Async ... ALL results from services are returned to WCF CallbackContract client services. I believe that the resonance for using CallbackContracts is to facilitate the use of the Publish-Subscribe model that we use. The problem is not that our communication is suitable for publishing-subscribing and using CallbackContracts means that we must include the source data in the returned result messages so that clients can decide what results were returned from ... again, clients have switch statements for development what to do with messages coming from MessageType-based services (and other built-in details).
In terms of topology: services form โnodesโ in a graph. Each service hard-coded a list of other services to which it should connect when it starts, and will not allow client services to "Register" with it until it makes all the connections it needs. As an example, we have a LoggingService and a DataAccessService. DataAccessSevice is a LoggingService client, so the DataAccess service will try to register with the LoggingService when it starts. Until he can successfully Register the DataAccess service, he will not allow clients to register with it. As a result, when the system starts up as a whole, services start in a cascading manner. I do not see this as a problem, but is it unusual?
To make things more complex, one of the system requirements is that services or โsitesโ do not have to be directly registered with each other in order to send messages to each other, but can be linked through indirect links. For example, suppose we have 3 services A, B, and C connected in a chain, A can send message C through B ... using 2 flights.
Actually, I was entrusted with this, and I wrote a routing system, it was fun, but the leadership remained before I could ask why it was really necessary. As far as I can see, there are no reasons why services cannot simply connect directly to other services that they need. Most of all, I had to write a reliability system on top of everything, since the requirement was to have reliable message passing through the nodes in the system, but with simple point-to-point connections, WCF reliably performs this work.
Prior to this project, I only worked on winforms desktop applications for 3 years, but did not know anything better. My suspicions that this project is too complex: I think my questions are:
1) Is this the idea of โโa graph topology with messages jumping on indirect links unusual? Why not just connect the services directly to the services that they need to access (which is actually what we do anyway ... I donโt think we have any messages jumping)?
2) Opens only 2 methods in OperationContract and uses the MessageType enumeration to determine what message is for / what is unusual to do with it? Should the WCF service expose many methods with specific goals, and the client chooses which methods he wants to call?
3) Makes all communication with the client through CallbackContracts unusual. Of course, synchronization or asyc request-request is easier.
4) Is the idea of โโa service that does not allow client services to connect to it (Register) until it connects to all its services (to which it is a client) sound design? I think this is the only design that I agree with, I mean that the DataAccessService should not accept clients until it is associated with the logging service.
I have so many WCF questions, more will appear in subsequent threads. Thanks in advance.