Solved

Explain the term "Granularity"

Posted on 2002-04-08
6
658 Views
Last Modified: 2012-08-14
Greetings all,

Could someone explain what the term "granualrity" means please when used in the context of object-oriented systems.

0
Comment
Question by:ruff_ryder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Accepted Solution

by:
jamoville earned 50 total points
ID: 6925595
Application Granularity:
One of the goals of object-oriented design is finer granularity. The purpose is to achieve a greater level of abstraction than possible with data/procedures-oriented design.
An application constructed with more finely granular objects (i.e. a lower number of functions per object) is likely to be more easily maintained because objects should be smaller and less complex.

More finely granular objects should also be more reusable. ... Therefore, each object's behavior should be more easily understood and analyzed.

                                 Total Number of Objects
      Application Granularity =  -------------------------
                                   Total Function Points"


0
 
LVL 3

Author Comment

by:ruff_ryder
ID: 6927307
Hi jamoville,

I rejected you answer just so that we can have more discussion on this. I really want to make sure I'm understanding properly.

From what you've posted, This is what I understand:

Object Granularity describes how rich/complex a class' interface is. That is, if a class has a large interface, then it has a fine granularity, if small interface it has a large Granularity (i.e closer to 1.0).

I'm working this based on the formula you gave with one object and small and large interface accordingly.
0
 
LVL 2

Expert Comment

by:LoungeLizard
ID: 6927365
Simply put, the granularity is a measure of the amount of functionality (in terms of actual code and contained objects) a object contains. The finer the granularity, the simpler the object is. In OOD this is the goal - have a lot of simple objects in stead of a huge complex one. The reasons are easy to understand - maintainabilty, upgradeablity, re-use and so on.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:ruff_ryder
ID: 6927383
Ok, I get you there. But doesn't having alot of objects in a system make it complex as well in terms of design?
0
 
LVL 2

Expert Comment

by:LoungeLizard
ID: 6927587
Initially, it might seem so. However, any given system has got X amount that it must do, and that must be explained/detailed in your design (if the design is to implemented thoroughly). So, whether you have a 10 page description of one class, or 10 single page descriptions of smaller classes with an extra page describing interactions, you end up with roughly the same amount of "work" to do in the design.

Of course there is overhead introduced by using smaller, simpler classes. But this initial outlay is more than compensated for in later stages of the development life-cycle when the inevitable addendums and alterations to the design happens. Also, for the programmers that has to implement the design, it is much easier to digest and implement/debug/test smaller pieces, if each piece is an independent entity.

Of course, there is a limit to everything. Breaking a class apart just for the sake of making it smaller isn't the idea.  
0
 
LVL 16

Expert Comment

by:imladris
ID: 6928429
Referring to your post of 04/08/2002 10:03PM, note that the granularity of the object with the smaller interface would be finer.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question