What are the various programming approaches for WCF?- There are three programming approaches in Windows Communication Foundation (WCF).
2. Configuration Based
- WCF is a unification technology that unites the .NET Remoting, MSMQ, Web services. COM+ technologies.
- It is a traditional way to write applications.
- Most developers are familiar with the imperative programming model, where you create a service and use a series of instructions and control logic to implement it.
- Imperative approach gives you full control over the implementation details.
- Small services are easier to implement.
- It focuses on what you want to accomplish and lets the compiler, interpreter or runtime solve the problem for you.
- In declarative approach, many developers must understand a new technology.
- It is difficult to create unit tests.
- The control flow is easier for a business analyst to understand.
- In this approach, configuration files can be used to accomplish a task and end points along with security settings.
- Attributes can be used for declaring the behaviors and contracts, configure endpoints, security and some other settings in configuration files and will implement service methods logic in codes.