Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

GDB CS304 <Starting Date> Wednesday, July 10, 2013 {{}} <Closing Date> Friday, July 12, 2013

GDB Discussion Topic


Suppose you are working as a software developer in a company. You have been given a task to develop a software system design for some real world scenario. One of the basic activities of any software system design is to establish relationships between classes. Suppose at the stage of creating relationships for some classes, you have to choose either inheritance or composition as these are two fundamental ways to relate classes by achieving feature of code re-usability. Being a developer, for what reasons, would you prefer one technique to the other keeping in mind the reusability factor? Support your answer with solid reasons.

GDB’s Instructions


  1. You need to provide precise and to the point answer, avoid irrelevant details.
  2. Copy from the internet or other student will get zero marks.
  1. You should post your answer on the Graded Discussion Board (GDB), not on the Moderated Discussion Board (MDB). Both will run parallel to each other during the specified time. Therefore, due care will be needed.
  2. You need to use font style as “Times New Roman” and font size 12.
  3. You cannot participate in the discussion after the due date via email.
  4. The GDB will open and close on specified date and time. Please note that no grace day or extra time will be given for posting comments on GDB.

Views: 4705

Replies to This Discussion

Inheritance is an object-oriented programming feature by which derived class can inherit accessible attributes and member functions of base class

using inheritance we can increase the reusability.

Features or Advantages of Inheritance:


Inheritance helps the code to be reused in many
situations. The base class is defined and once it is
compiled, it need not be reworked. Using the concept of
inheritance, the programmer can create as many derived
classes from the base class as needed while adding specific
features to each derived class as needed.

---Saves Time and Effort:

The above concept of reusability achieved by inheritance
saves the programmer time and effort. Since the main code
written can be reused in various situations as needed.

---Increases Program Structure which results in greater

inheritance has the following main advantages:
we can extend the already made classes by adding some new 
it is easy to debug a program when divided in parts. 
inheritance provides an opportunity to capture the problem

Definitely Composition method

Reasons: easy to change the front-end and back-end class as compared to the superclass.

Provides strong encapsulation.


© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service