santosh singh
santosh singh

Reputation: 28652

What is the difference between "service" and "component"?

I am little bit confused about the difference between a service and component. Can someone explain with example that what is the difference between a service and component?

Upvotes: 9

Views: 10458

Answers (4)

theaviatorcodes
theaviatorcodes

Reputation: 1

Services are designed with reusability in mind; a service can be made by combining different components together. But the idea is that when one service fails in a microservice (i.e., an entire system), it won't affect the running of other services in that system. They are designed to be self-sustaining.

For components, they are designed to fit into an application, and their effectiveness largely depends on the whole system working as well, but they are also reusable.

Upvotes: 0

hodadisbirhan
hodadisbirhan

Reputation: 1

services have only provide interface that allow to access the functionality of service and also they are used remotely using some mechanism of message communication model like Remote Procedure call where as Components have both Provide and require interface to communicate with the other component in order to perform the intended functionality and they are used locally

Upvotes: 0

Cos Callis
Cos Callis

Reputation: 5084

Services are applications that are (generally) designed to be long running, tied to the operations of the system rather than a user and provide a utility to other applications. Databases, SMTP, Active Directory are all examples of "Services".

Components are pre-formed pieces that can be included in other applications and are not designed to operate 'on their own'. An application that references a database my use a data component (SQLClient) to communicate with a date base service (MS SQL Server).

Upvotes: 4

Haris Hasan
Haris Hasan

Reputation: 30097

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

The service's user don't need to know anything about the underlying components. User will deal only directly with the service while service internally will be interacting with the components

Upvotes: 14

Related Questions