Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Explain the term "Granularity"

Posted on 2002-04-08
6
Medium Priority
?
664 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
6 Comments
 
LVL 5

Accepted Solution

by:
jamoville earned 150 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

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!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

916 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