What is service granularity?

5

What is service granularity in SOA?

What is the difference between fine and coarse granularity?

    
asked by anonymous 03.06.2014 / 17:17

1 answer

5

"Service granularity" is used to measure the depth of abstraction which has been applied in services.

The granularity can be divided into two parts, being:

  • Fine-grained granularity: It determines that we need many "grains". We will have services with few operations, but we will divide these operations by several services.

Example: Splitting CRUD operations from clients via WCF service into two services

CustomerService with operations / methods CreateClient (), UpdateClient () and DeleteClient ()

ServiceValidCadastroCustomer with operations / methods Validate Client (), Validate ClientValue () and ValidateExclusionCustomer

  • Coarse-grained granularity: It determines that we will have few "grains", much larger. We will have few services, but each will contain a much larger portion of operations.

Example: Define only one service for the operations of a client CRUD via WCF service

CustomerService with operations / methods CreateClient (), UpdateClient (), DeleteClient (), ValidateCustomer (), ValidateCustomerUpgrade (), and ValidateExclusionClient

    
03.06.2014 / 20:50