Service vs. Component

I was having trouble to differentiate between both nor could I 100% explain to someone what’s the real difference between a Service and a Component. Today I’ve found a really nice definition by Martin Fowler which I would like to share with you:

Component

I use component to mean a glob of software that’s intended to be used, without change, by application that is out of the control of the writers of the component. By ‘without change’ I mean that the using application doesn’t change the source code of the components, although they may alter the component’s behavior by extending it in ways allowed by the component writers. – Martin Fowler, Inversion of Control Containers and the Dependency Injection pattern

Service

A service is similar to a component in that it’s used by foreign applications. The main difference is that I expect a component to be used locally (think jar file, assembly, dll, or a source import). A service will be used remotely through some remote interface, either synchronous or asynchronous (eg web service, messaging system, RPC, or socket.) – Martin Fowler, Inversion of Control Containers and the Dependency Injection pattern


1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 4.00 out of 5)
Loading ... Loading ...

One Comment

  1. Dee says:

    HEy, i had the same troubles. This definition really comes in handy

Leave a Reply