Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the advantages and disadvantages of using services over components?

From past few months I am working on projects in latest dot net frameworks.

I feel that in latest dot net versions "services" are encouraged over components. Is that correct?

I have seen in silver light (I am a beginner in silver light) all the DB layer operations are exposed as services. I don't know right now component programs also are available?

What is the advantages? What about the performance if all the layers are exposed as services instead of DLLS?

Please through some light on this subject that where should I begin to understand this concept correctly?

Thanks

SC

like image 686
SNA Avatar asked Jun 10 '09 04:06

SNA


People also ask

What is the difference between services and components?

A service can be made up of several components. Usually a service provides one complete feature that is made up by combining different components. Save this answer.

What are the advantages of using components?

Components allow for far more possibilities in terms of product design and can be configured to provide optimal performance for the target application. - Cost control: Starting from the sensor gives manufacturers control over final camera costs.

What are the disadvantages of COM components?

Disadvantages of COM components. The main disadvantage is that the COM components must be registered on the client system, it's impossible to run more than one version on the same system, and there is a performance hit in the COM Interop layer.

What is the Disadvantage of service Oriented architecture?

Cons of SOA: Large upfront investment. SOA architecture is a great choice for further business development. It enables your team to work on several applications simultaneously at a smaller cost.


2 Answers

Something else to consider -- just because functionality is exposed as a "service" doesn't mean that it has to be hosted somewhere or exposed as a webservice.

You could very well access a service directly, in memory.

Exposing related functionality as a service is more about the interaction between various pieces of your application. It doesn't say anything about how you deploy/access these pieces.

like image 164
Nader Shirazie Avatar answered Sep 19 '22 09:09

Nader Shirazie


It's really all to do with a Service Oriented Architecture - something that's been common for a while and is very popular.

The idea is that distinct operations are decoupled from each other so they can be reused and modified without recompiling the apps that use it. Rather than a piece of code in a DLL being modified and copied everywhere, a service can be deployed that represents a single point of access for a particular piece of processing or source of information.

Say you had a credit card validation component. You may write this code and compile it into a DLL and start including that in all your applications. Nothing wrong with that unless you notice a bug or the rules for CC validation change. Or maybe you want to upgrade it to check it against a blacklist. You can't do any of those things without recompiling the apps that use it.

If your credit card validation is exposed as a service however, you can make the changes and deploy to one location. Provided the signature is the same (same parameters and response), the applications don't even have to know it's changed.

Another advantage of using services over components is that the services can be hosted anywhere. They can be on the local server or on the other side of the world.

Having said this, like everything you should decide the architecture on a case-by-case basis. While the credit-card validation was a good example of when a service is useful, providing a service to render HTML controls doesn't make much sense.

like image 27
Damovisa Avatar answered Sep 18 '22 09:09

Damovisa