Coarse-grained vs fine-grained











up vote
90
down vote

favorite
24












What is the difference between coarse-grained and fine-grained?



I have searched these terms on Google, but I couldn't find what they mean.










share|improve this question
























  • I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
    – fosb
    Sep 13 '17 at 19:58

















up vote
90
down vote

favorite
24












What is the difference between coarse-grained and fine-grained?



I have searched these terms on Google, but I couldn't find what they mean.










share|improve this question
























  • I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
    – fosb
    Sep 13 '17 at 19:58















up vote
90
down vote

favorite
24









up vote
90
down vote

favorite
24






24





What is the difference between coarse-grained and fine-grained?



I have searched these terms on Google, but I couldn't find what they mean.










share|improve this question















What is the difference between coarse-grained and fine-grained?



I have searched these terms on Google, but I couldn't find what they mean.







terminology granularity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 12:21









Stephen Kennedy

6,929134866




6,929134866










asked Sep 22 '10 at 6:33









LoveTW

1,48193045




1,48193045












  • I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
    – fosb
    Sep 13 '17 at 19:58




















  • I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
    – fosb
    Sep 13 '17 at 19:58


















I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
– fosb
Sep 13 '17 at 19:58






I think the question is not specific enough. These terms are not only used to desribe the granularity of system components. They are also used to describe the granularity of access control (and probably there are more usages...).
– fosb
Sep 13 '17 at 19:58














9 Answers
9






active

oldest

votes

















up vote
98
down vote



accepted










From Wikipedia (granularity):




Granularity is the extent to which a
system is broken down into small
parts, either the system itself or its
description or observation. It is the
extent to which a larger entity is
subdivided. For example, a yard broken
into inches has finer granularity than
a yard broken into feet.



Coarse-grained systems consist of
fewer, larger components than
fine-grained systems; a coarse-grained
description of a system regards large
subcomponents while a fine-grained
description regards smaller components
of which the larger ones are composed.







share|improve this answer




























    up vote
    22
    down vote













    In simple terms





    • Coarse-grained - larger components than fine-grained, large subcomponents. Simply wraps one or more fine-grained services together into a more coarse­-grained operation.


    • Fine-grained - smaller components of which the larger ones are composed, lower­level service


    It is better to have more coarse-grained service operations, which are composed by fine-grained operations



    enter image description here






    share|improve this answer




























      up vote
      16
      down vote













      Coarse-grained: A few ojects hold a lot of related data that's why services have broader scope in functionality. Example: A single "Account" object holds the customer name, address, account balance, opening date, last change date, etc.
      Thus: Increased design complexity, smaller number of cells to various operations



      Fine-grained: More objects each holding less data that's why services have more narrow scope in functionality. Example: An Account object holds balance, a Customer object holds name and address, a AccountOpenings object holds opening date, etc.
      Thus: Decreased design complexity , higher number of cells to various service operations.
      These are relationships defined between these objects.






      share|improve this answer























      • It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
        – Humaun Rashid
        May 18 '16 at 4:57


















      up vote
      4
      down vote













      One more way to understand would be to think in terms of communication between processes and threads. Processes communicate with the help of coarse grained communication mechanisms like sockets, signal handlers, shared memory, semaphores and files. Threads, on the other hand, have access to shared memory space that belongs to a process, which allows them to apply finer grain communication mechanisms.



      Source: Java concurrency in practice






      share|improve this answer






























        up vote
        2
        down vote













        In the context of services:



        http://en.wikipedia.org/wiki/Service_Granularity_Principle




        By definition a coarse-grained service operation has broader scope
        than a fine-grained service, although the terms are relative. The
        former typically requires increased design complexity but can reduce
        the number of calls required to complete a task.




        A fine grained service interface is about the same like chatty interface.






        share|improve this answer




























          up vote
          1
          down vote













          Coarse-grained granularity does not always mean bigger components, if you go by literally meaning of the word coarse, it means harsh, or not appropriate. e.g. In software projects management, if you breakdown a small system into few components, which are equal in size, but varies in complexities and features, this could lead to a coarse-grained granularity. In reverse, for a fine-grained breakdown, you would divide the components based on their cohesiveness of the functionalities each component is providing.






          share|improve this answer




























            up vote
            1
            down vote













            coarse grained and fine grained. Both of these modes define how the cores are shared
            between multiple Spark tasks. As the name suggests, fine-grained mode is
            responsible for sharing the cores at a more granular level. Fine-grained mode has been deprecated by Spark and will soon be removed.






            share|improve this answer




























              up vote
              1
              down vote













              In term of dataset like a text file ,Coarse-grained meaning we can transform the whole dataset but not an individual element on the dataset While fine-grained means we can transform individual element on the dataset.






              share|improve this answer




























                up vote
                0
                down vote













                Coarse-grained and Fine-grained both think about optimizing a number of servicess. But the difference is in the level. I like to explain with an example, you will understand easily.



                Fine-grained: For example, I have 100 services like findbyId, findbyCategry, findbyName...... so on. Instead of that many services why we can not provide find(id, category, name....so on). So this way we can reduce the services. This is just an example, but the goal is how to optimize the number of services.



                Coarse-grained: For example, I have 100 clients, each client have their own set of 100 services. So I have to provide 100*100 total services. It is very much difficult. Instead of that what I do is, I identify all common services which apply to most of the clients as one service set and remaining separately. For example in 100 services 50 services are common. So I have to manage 100*50 + 50 only.






                share|improve this answer





















                  Your Answer






                  StackExchange.ifUsing("editor", function () {
                  StackExchange.using("externalEditor", function () {
                  StackExchange.using("snippets", function () {
                  StackExchange.snippets.init();
                  });
                  });
                  }, "code-snippets");

                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "1"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3766845%2fcoarse-grained-vs-fine-grained%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  9 Answers
                  9






                  active

                  oldest

                  votes








                  9 Answers
                  9






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  98
                  down vote



                  accepted










                  From Wikipedia (granularity):




                  Granularity is the extent to which a
                  system is broken down into small
                  parts, either the system itself or its
                  description or observation. It is the
                  extent to which a larger entity is
                  subdivided. For example, a yard broken
                  into inches has finer granularity than
                  a yard broken into feet.



                  Coarse-grained systems consist of
                  fewer, larger components than
                  fine-grained systems; a coarse-grained
                  description of a system regards large
                  subcomponents while a fine-grained
                  description regards smaller components
                  of which the larger ones are composed.







                  share|improve this answer

























                    up vote
                    98
                    down vote



                    accepted










                    From Wikipedia (granularity):




                    Granularity is the extent to which a
                    system is broken down into small
                    parts, either the system itself or its
                    description or observation. It is the
                    extent to which a larger entity is
                    subdivided. For example, a yard broken
                    into inches has finer granularity than
                    a yard broken into feet.



                    Coarse-grained systems consist of
                    fewer, larger components than
                    fine-grained systems; a coarse-grained
                    description of a system regards large
                    subcomponents while a fine-grained
                    description regards smaller components
                    of which the larger ones are composed.







                    share|improve this answer























                      up vote
                      98
                      down vote



                      accepted







                      up vote
                      98
                      down vote



                      accepted






                      From Wikipedia (granularity):




                      Granularity is the extent to which a
                      system is broken down into small
                      parts, either the system itself or its
                      description or observation. It is the
                      extent to which a larger entity is
                      subdivided. For example, a yard broken
                      into inches has finer granularity than
                      a yard broken into feet.



                      Coarse-grained systems consist of
                      fewer, larger components than
                      fine-grained systems; a coarse-grained
                      description of a system regards large
                      subcomponents while a fine-grained
                      description regards smaller components
                      of which the larger ones are composed.







                      share|improve this answer












                      From Wikipedia (granularity):




                      Granularity is the extent to which a
                      system is broken down into small
                      parts, either the system itself or its
                      description or observation. It is the
                      extent to which a larger entity is
                      subdivided. For example, a yard broken
                      into inches has finer granularity than
                      a yard broken into feet.



                      Coarse-grained systems consist of
                      fewer, larger components than
                      fine-grained systems; a coarse-grained
                      description of a system regards large
                      subcomponents while a fine-grained
                      description regards smaller components
                      of which the larger ones are composed.








                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Sep 22 '10 at 6:39









                      Michael Petrotta

                      51.2k12127170




                      51.2k12127170
























                          up vote
                          22
                          down vote













                          In simple terms





                          • Coarse-grained - larger components than fine-grained, large subcomponents. Simply wraps one or more fine-grained services together into a more coarse­-grained operation.


                          • Fine-grained - smaller components of which the larger ones are composed, lower­level service


                          It is better to have more coarse-grained service operations, which are composed by fine-grained operations



                          enter image description here






                          share|improve this answer

























                            up vote
                            22
                            down vote













                            In simple terms





                            • Coarse-grained - larger components than fine-grained, large subcomponents. Simply wraps one or more fine-grained services together into a more coarse­-grained operation.


                            • Fine-grained - smaller components of which the larger ones are composed, lower­level service


                            It is better to have more coarse-grained service operations, which are composed by fine-grained operations



                            enter image description here






                            share|improve this answer























                              up vote
                              22
                              down vote










                              up vote
                              22
                              down vote









                              In simple terms





                              • Coarse-grained - larger components than fine-grained, large subcomponents. Simply wraps one or more fine-grained services together into a more coarse­-grained operation.


                              • Fine-grained - smaller components of which the larger ones are composed, lower­level service


                              It is better to have more coarse-grained service operations, which are composed by fine-grained operations



                              enter image description here






                              share|improve this answer












                              In simple terms





                              • Coarse-grained - larger components than fine-grained, large subcomponents. Simply wraps one or more fine-grained services together into a more coarse­-grained operation.


                              • Fine-grained - smaller components of which the larger ones are composed, lower­level service


                              It is better to have more coarse-grained service operations, which are composed by fine-grained operations



                              enter image description here







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered May 27 '15 at 14:53









                              Techie

                              29k33124203




                              29k33124203






















                                  up vote
                                  16
                                  down vote













                                  Coarse-grained: A few ojects hold a lot of related data that's why services have broader scope in functionality. Example: A single "Account" object holds the customer name, address, account balance, opening date, last change date, etc.
                                  Thus: Increased design complexity, smaller number of cells to various operations



                                  Fine-grained: More objects each holding less data that's why services have more narrow scope in functionality. Example: An Account object holds balance, a Customer object holds name and address, a AccountOpenings object holds opening date, etc.
                                  Thus: Decreased design complexity , higher number of cells to various service operations.
                                  These are relationships defined between these objects.






                                  share|improve this answer























                                  • It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                    – Humaun Rashid
                                    May 18 '16 at 4:57















                                  up vote
                                  16
                                  down vote













                                  Coarse-grained: A few ojects hold a lot of related data that's why services have broader scope in functionality. Example: A single "Account" object holds the customer name, address, account balance, opening date, last change date, etc.
                                  Thus: Increased design complexity, smaller number of cells to various operations



                                  Fine-grained: More objects each holding less data that's why services have more narrow scope in functionality. Example: An Account object holds balance, a Customer object holds name and address, a AccountOpenings object holds opening date, etc.
                                  Thus: Decreased design complexity , higher number of cells to various service operations.
                                  These are relationships defined between these objects.






                                  share|improve this answer























                                  • It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                    – Humaun Rashid
                                    May 18 '16 at 4:57













                                  up vote
                                  16
                                  down vote










                                  up vote
                                  16
                                  down vote









                                  Coarse-grained: A few ojects hold a lot of related data that's why services have broader scope in functionality. Example: A single "Account" object holds the customer name, address, account balance, opening date, last change date, etc.
                                  Thus: Increased design complexity, smaller number of cells to various operations



                                  Fine-grained: More objects each holding less data that's why services have more narrow scope in functionality. Example: An Account object holds balance, a Customer object holds name and address, a AccountOpenings object holds opening date, etc.
                                  Thus: Decreased design complexity , higher number of cells to various service operations.
                                  These are relationships defined between these objects.






                                  share|improve this answer














                                  Coarse-grained: A few ojects hold a lot of related data that's why services have broader scope in functionality. Example: A single "Account" object holds the customer name, address, account balance, opening date, last change date, etc.
                                  Thus: Increased design complexity, smaller number of cells to various operations



                                  Fine-grained: More objects each holding less data that's why services have more narrow scope in functionality. Example: An Account object holds balance, a Customer object holds name and address, a AccountOpenings object holds opening date, etc.
                                  Thus: Decreased design complexity , higher number of cells to various service operations.
                                  These are relationships defined between these objects.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Jan 13 '16 at 16:40

























                                  answered Jan 13 '16 at 16:30









                                  Humaun Rashid

                                  683719




                                  683719












                                  • It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                    – Humaun Rashid
                                    May 18 '16 at 4:57


















                                  • It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                    – Humaun Rashid
                                    May 18 '16 at 4:57
















                                  It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                  – Humaun Rashid
                                  May 18 '16 at 4:57




                                  It is better to have more coarse-grained service operations, which are composed by fine-grained operations.
                                  – Humaun Rashid
                                  May 18 '16 at 4:57










                                  up vote
                                  4
                                  down vote













                                  One more way to understand would be to think in terms of communication between processes and threads. Processes communicate with the help of coarse grained communication mechanisms like sockets, signal handlers, shared memory, semaphores and files. Threads, on the other hand, have access to shared memory space that belongs to a process, which allows them to apply finer grain communication mechanisms.



                                  Source: Java concurrency in practice






                                  share|improve this answer



























                                    up vote
                                    4
                                    down vote













                                    One more way to understand would be to think in terms of communication between processes and threads. Processes communicate with the help of coarse grained communication mechanisms like sockets, signal handlers, shared memory, semaphores and files. Threads, on the other hand, have access to shared memory space that belongs to a process, which allows them to apply finer grain communication mechanisms.



                                    Source: Java concurrency in practice






                                    share|improve this answer

























                                      up vote
                                      4
                                      down vote










                                      up vote
                                      4
                                      down vote









                                      One more way to understand would be to think in terms of communication between processes and threads. Processes communicate with the help of coarse grained communication mechanisms like sockets, signal handlers, shared memory, semaphores and files. Threads, on the other hand, have access to shared memory space that belongs to a process, which allows them to apply finer grain communication mechanisms.



                                      Source: Java concurrency in practice






                                      share|improve this answer














                                      One more way to understand would be to think in terms of communication between processes and threads. Processes communicate with the help of coarse grained communication mechanisms like sockets, signal handlers, shared memory, semaphores and files. Threads, on the other hand, have access to shared memory space that belongs to a process, which allows them to apply finer grain communication mechanisms.



                                      Source: Java concurrency in practice







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Jan 2 '16 at 18:31









                                      Ajay

                                      13.3k83976




                                      13.3k83976










                                      answered Mar 4 '15 at 18:39









                                      Sumeer Sinha

                                      412




                                      412






















                                          up vote
                                          2
                                          down vote













                                          In the context of services:



                                          http://en.wikipedia.org/wiki/Service_Granularity_Principle




                                          By definition a coarse-grained service operation has broader scope
                                          than a fine-grained service, although the terms are relative. The
                                          former typically requires increased design complexity but can reduce
                                          the number of calls required to complete a task.




                                          A fine grained service interface is about the same like chatty interface.






                                          share|improve this answer

























                                            up vote
                                            2
                                            down vote













                                            In the context of services:



                                            http://en.wikipedia.org/wiki/Service_Granularity_Principle




                                            By definition a coarse-grained service operation has broader scope
                                            than a fine-grained service, although the terms are relative. The
                                            former typically requires increased design complexity but can reduce
                                            the number of calls required to complete a task.




                                            A fine grained service interface is about the same like chatty interface.






                                            share|improve this answer























                                              up vote
                                              2
                                              down vote










                                              up vote
                                              2
                                              down vote









                                              In the context of services:



                                              http://en.wikipedia.org/wiki/Service_Granularity_Principle




                                              By definition a coarse-grained service operation has broader scope
                                              than a fine-grained service, although the terms are relative. The
                                              former typically requires increased design complexity but can reduce
                                              the number of calls required to complete a task.




                                              A fine grained service interface is about the same like chatty interface.






                                              share|improve this answer












                                              In the context of services:



                                              http://en.wikipedia.org/wiki/Service_Granularity_Principle




                                              By definition a coarse-grained service operation has broader scope
                                              than a fine-grained service, although the terms are relative. The
                                              former typically requires increased design complexity but can reduce
                                              the number of calls required to complete a task.




                                              A fine grained service interface is about the same like chatty interface.







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Jan 20 '15 at 19:31









                                              user3285954

                                              3,05321714




                                              3,05321714






















                                                  up vote
                                                  1
                                                  down vote













                                                  Coarse-grained granularity does not always mean bigger components, if you go by literally meaning of the word coarse, it means harsh, or not appropriate. e.g. In software projects management, if you breakdown a small system into few components, which are equal in size, but varies in complexities and features, this could lead to a coarse-grained granularity. In reverse, for a fine-grained breakdown, you would divide the components based on their cohesiveness of the functionalities each component is providing.






                                                  share|improve this answer

























                                                    up vote
                                                    1
                                                    down vote













                                                    Coarse-grained granularity does not always mean bigger components, if you go by literally meaning of the word coarse, it means harsh, or not appropriate. e.g. In software projects management, if you breakdown a small system into few components, which are equal in size, but varies in complexities and features, this could lead to a coarse-grained granularity. In reverse, for a fine-grained breakdown, you would divide the components based on their cohesiveness of the functionalities each component is providing.






                                                    share|improve this answer























                                                      up vote
                                                      1
                                                      down vote










                                                      up vote
                                                      1
                                                      down vote









                                                      Coarse-grained granularity does not always mean bigger components, if you go by literally meaning of the word coarse, it means harsh, or not appropriate. e.g. In software projects management, if you breakdown a small system into few components, which are equal in size, but varies in complexities and features, this could lead to a coarse-grained granularity. In reverse, for a fine-grained breakdown, you would divide the components based on their cohesiveness of the functionalities each component is providing.






                                                      share|improve this answer












                                                      Coarse-grained granularity does not always mean bigger components, if you go by literally meaning of the word coarse, it means harsh, or not appropriate. e.g. In software projects management, if you breakdown a small system into few components, which are equal in size, but varies in complexities and features, this could lead to a coarse-grained granularity. In reverse, for a fine-grained breakdown, you would divide the components based on their cohesiveness of the functionalities each component is providing.







                                                      share|improve this answer












                                                      share|improve this answer



                                                      share|improve this answer










                                                      answered Sep 18 '15 at 13:59









                                                      Abhishek Singh

                                                      683613




                                                      683613






















                                                          up vote
                                                          1
                                                          down vote













                                                          coarse grained and fine grained. Both of these modes define how the cores are shared
                                                          between multiple Spark tasks. As the name suggests, fine-grained mode is
                                                          responsible for sharing the cores at a more granular level. Fine-grained mode has been deprecated by Spark and will soon be removed.






                                                          share|improve this answer

























                                                            up vote
                                                            1
                                                            down vote













                                                            coarse grained and fine grained. Both of these modes define how the cores are shared
                                                            between multiple Spark tasks. As the name suggests, fine-grained mode is
                                                            responsible for sharing the cores at a more granular level. Fine-grained mode has been deprecated by Spark and will soon be removed.






                                                            share|improve this answer























                                                              up vote
                                                              1
                                                              down vote










                                                              up vote
                                                              1
                                                              down vote









                                                              coarse grained and fine grained. Both of these modes define how the cores are shared
                                                              between multiple Spark tasks. As the name suggests, fine-grained mode is
                                                              responsible for sharing the cores at a more granular level. Fine-grained mode has been deprecated by Spark and will soon be removed.






                                                              share|improve this answer












                                                              coarse grained and fine grained. Both of these modes define how the cores are shared
                                                              between multiple Spark tasks. As the name suggests, fine-grained mode is
                                                              responsible for sharing the cores at a more granular level. Fine-grained mode has been deprecated by Spark and will soon be removed.







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Aug 22 '17 at 18:46









                                                              Pinaki Mukherjee

                                                              80411222




                                                              80411222






















                                                                  up vote
                                                                  1
                                                                  down vote













                                                                  In term of dataset like a text file ,Coarse-grained meaning we can transform the whole dataset but not an individual element on the dataset While fine-grained means we can transform individual element on the dataset.






                                                                  share|improve this answer

























                                                                    up vote
                                                                    1
                                                                    down vote













                                                                    In term of dataset like a text file ,Coarse-grained meaning we can transform the whole dataset but not an individual element on the dataset While fine-grained means we can transform individual element on the dataset.






                                                                    share|improve this answer























                                                                      up vote
                                                                      1
                                                                      down vote










                                                                      up vote
                                                                      1
                                                                      down vote









                                                                      In term of dataset like a text file ,Coarse-grained meaning we can transform the whole dataset but not an individual element on the dataset While fine-grained means we can transform individual element on the dataset.






                                                                      share|improve this answer












                                                                      In term of dataset like a text file ,Coarse-grained meaning we can transform the whole dataset but not an individual element on the dataset While fine-grained means we can transform individual element on the dataset.







                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered Dec 13 '17 at 16:10









                                                                      Manish Pansari

                                                                      16116




                                                                      16116






















                                                                          up vote
                                                                          0
                                                                          down vote













                                                                          Coarse-grained and Fine-grained both think about optimizing a number of servicess. But the difference is in the level. I like to explain with an example, you will understand easily.



                                                                          Fine-grained: For example, I have 100 services like findbyId, findbyCategry, findbyName...... so on. Instead of that many services why we can not provide find(id, category, name....so on). So this way we can reduce the services. This is just an example, but the goal is how to optimize the number of services.



                                                                          Coarse-grained: For example, I have 100 clients, each client have their own set of 100 services. So I have to provide 100*100 total services. It is very much difficult. Instead of that what I do is, I identify all common services which apply to most of the clients as one service set and remaining separately. For example in 100 services 50 services are common. So I have to manage 100*50 + 50 only.






                                                                          share|improve this answer

























                                                                            up vote
                                                                            0
                                                                            down vote













                                                                            Coarse-grained and Fine-grained both think about optimizing a number of servicess. But the difference is in the level. I like to explain with an example, you will understand easily.



                                                                            Fine-grained: For example, I have 100 services like findbyId, findbyCategry, findbyName...... so on. Instead of that many services why we can not provide find(id, category, name....so on). So this way we can reduce the services. This is just an example, but the goal is how to optimize the number of services.



                                                                            Coarse-grained: For example, I have 100 clients, each client have their own set of 100 services. So I have to provide 100*100 total services. It is very much difficult. Instead of that what I do is, I identify all common services which apply to most of the clients as one service set and remaining separately. For example in 100 services 50 services are common. So I have to manage 100*50 + 50 only.






                                                                            share|improve this answer























                                                                              up vote
                                                                              0
                                                                              down vote










                                                                              up vote
                                                                              0
                                                                              down vote









                                                                              Coarse-grained and Fine-grained both think about optimizing a number of servicess. But the difference is in the level. I like to explain with an example, you will understand easily.



                                                                              Fine-grained: For example, I have 100 services like findbyId, findbyCategry, findbyName...... so on. Instead of that many services why we can not provide find(id, category, name....so on). So this way we can reduce the services. This is just an example, but the goal is how to optimize the number of services.



                                                                              Coarse-grained: For example, I have 100 clients, each client have their own set of 100 services. So I have to provide 100*100 total services. It is very much difficult. Instead of that what I do is, I identify all common services which apply to most of the clients as one service set and remaining separately. For example in 100 services 50 services are common. So I have to manage 100*50 + 50 only.






                                                                              share|improve this answer












                                                                              Coarse-grained and Fine-grained both think about optimizing a number of servicess. But the difference is in the level. I like to explain with an example, you will understand easily.



                                                                              Fine-grained: For example, I have 100 services like findbyId, findbyCategry, findbyName...... so on. Instead of that many services why we can not provide find(id, category, name....so on). So this way we can reduce the services. This is just an example, but the goal is how to optimize the number of services.



                                                                              Coarse-grained: For example, I have 100 clients, each client have their own set of 100 services. So I have to provide 100*100 total services. It is very much difficult. Instead of that what I do is, I identify all common services which apply to most of the clients as one service set and remaining separately. For example in 100 services 50 services are common. So I have to manage 100*50 + 50 only.







                                                                              share|improve this answer












                                                                              share|improve this answer



                                                                              share|improve this answer










                                                                              answered Nov 8 at 6:22









                                                                              Sun

                                                                              1,17433047




                                                                              1,17433047






























                                                                                  draft saved

                                                                                  draft discarded




















































                                                                                  Thanks for contributing an answer to Stack Overflow!


                                                                                  • Please be sure to answer the question. Provide details and share your research!

                                                                                  But avoid



                                                                                  • Asking for help, clarification, or responding to other answers.

                                                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                                                  To learn more, see our tips on writing great answers.





                                                                                  Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                                                  Please pay close attention to the following guidance:


                                                                                  • Please be sure to answer the question. Provide details and share your research!

                                                                                  But avoid



                                                                                  • Asking for help, clarification, or responding to other answers.

                                                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                                                  To learn more, see our tips on writing great answers.




                                                                                  draft saved


                                                                                  draft discarded














                                                                                  StackExchange.ready(
                                                                                  function () {
                                                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f3766845%2fcoarse-grained-vs-fine-grained%23new-answer', 'question_page');
                                                                                  }
                                                                                  );

                                                                                  Post as a guest















                                                                                  Required, but never shown





















































                                                                                  Required, but never shown














                                                                                  Required, but never shown












                                                                                  Required, but never shown







                                                                                  Required, but never shown

































                                                                                  Required, but never shown














                                                                                  Required, but never shown












                                                                                  Required, but never shown







                                                                                  Required, but never shown