Last post Sep 21, 2013 01:33 AM by shabirhakim1
Sep 20, 2013 05:04 PM|JacobPressures|LINK
Are there two or more ways to couple and decouple the service type and service contract?
The book I'm reading speaks of coupling and decoupling in two different ways. Am I reading it wrong? I can provide examples but I'm trying not to over complicate this post.
1) She speaks of coupling and decoupling the service contract and service type. Basically coupled is when you don't define an interface for the service contract. You just use the type. Decoupling is when you use an interface as the contract and a type to
implement the interface.
2) But she also seems to talk about coupling the service contract (interface) and service type (class implementation) by placing them both in the same assembly. I understand assembly to mean class file (.cs).
ARe both of these coupling/decoupling scenarios? How do you differentiate between the types in conversation? Do they have different names?
I can copy the actual text if necessary. But i was hoping you might understand without all the extra reading.
Sep 21, 2013 01:33 AM|shabirhakim1|LINK
What i believe is that it is just one concept and secondry is that it is often a good practice to let your code files contain only a single class, or a single interface. But these coding practices are a meansultimately.To better structure your code making
it easier to work with. If You are comfort to work with if the classes are kept together with their interfaces, by all means do so.Again ,For me I prefer to have the interface and class in the same file when there is just one class that implements the interface,