Anonymous

Can You Define Reusability In Object-Oriented Programming?

7

7 Answers

raaga Profile
raaga answered
Object oriented programming is the most preferred programming technique now a day only due to the flexibility of re usability. Re usability is actually an attribute that makes the object oriented programming more flexible and attractive.

As this programming is based on objects. Object is actually a collection of data and functions that are used to operate on that data. These objects are defined as independent entities because the data inside each object represents the attributes of object and functions are used to change these attributes as required by a program.

These objects act just like spare parts of any program. Thus, they are not limited to any specific program; rather they can be used in more than one application as required.
These objects are defined as an independent entity in a program, and afterward they can be used in any other program that needs the same functionality. This reuse of objects helps in reducing the development time of programs.

This reuse also plays a basic role in inheritance that is a characteristic of object oriented programming.In inheritance, new objects are defined that inherit the existing objects and provide extended functionality as required. It means that if we require some new object that also needs some functionality of existing one's then it is easy to inherit the existing one instead of writing all the required code once again.
Anonymous Profile
Anonymous answered
Reusable software reduce design,coding,and testing cost by amortizing effort over several applications.reducing the amount of code also simplifies understanding,which increase the likelihood that the code is correct.there are 2 kinds of reuse:sharing of newly written code within an application and reuse of previously written code on new application.
Anonymous Profile
Anonymous answered
Reusability can be achieved through
Anonymous Profile
Anonymous answered
Define static class members with example?
Nihar More..... Profile
Nihar More..... answered

Reusability In OOP

  In OOP, The concept of inheritance provide the idea of reusability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined features of both the classes. The real appeal and power of the inheritance mechanism is that it allows the programmer to reuse a class that is almost, but not exactly, what he wants, and to tailor the class in such a way that it does not introduce any undesirable side effects into the rest of the classes.

Fig.5 : Property inheritance

Note that each sub class defines only those features that are unique to it. Without the use of classification, each class would have to explicitly include all of its features.

To learn more programming stuff visit https://hackr.io/

Florio Potter Profile
Florio Potter answered

One of the promises which OOP (Object-Oriented Programming) holds is that it enhances software re-usability. Indeed, software components designed in OOP is easier to be reused than those designed in conventional programming. But the state-of-the-art software re-usability in most OOP environments is still very limited.

if you want to learn more then you can get help from our experts at CodeAvail- Online Computer Science Assignment
help

Anonymous Profile
Anonymous answered
Reusability

A principal goal of object-oriented programming is to make the code you write as reusable as possible--to have it serve many different situations and applications--so that you can avoid reimplementing, even if in only slightly different form, something that's already been done.
Reusability is influenced by a variety of different factors, including:

How reliable and bug-free the code is
How clear the documentation is
How simple and straightforward the programming interface is
How efficiently the code performs its tasks
How full the feature set is
Clearly, these factors don't apply just to the object model. They can be used to judge the reusability of any code--standard C functions as well as class definitions. Efficient and well documented functions, for example, would be more reusable than undocumented and unreliable ones.
Nevertheless, a general comparison would show that class definitions lend themselves to reusable code in ways that functions do not. There are various things you can do to make functions more reusable--passing data as arguments rather than assuming specifically-named global variables, for example. Even so, it turns out that only a small subset of functions can be generalized beyond the applications they were originally designed for. Their reusability is inherently limited in at least three ways:

Function names are global variables; each function must have a unique name (except for those declared static). This makes it difficult to rely heavily on library code when building a complex system. The programming interface would be hard to learn and so extensive that it couldn't easily capture significant generalizations.
Classes, on the other hand, can share programming interfaces. When the same naming conventions are used over and over again, a great deal of functionality can be packaged with a relatively small and easy-to-understand interface.
Functions are selected from a library one at a time. It's up to programmers to pick and choose the individual functions they need.
In contrast, objects come as packages of functionality, not as individual methods and instance variables. They provide integrated services, so users of an object-oriented library won't get bogged down piecing together their own solutions to a problem.
Functions are typically tied to particular kinds of data structures devised for a specific program. The interaction between data and function is an unavoidable part of the interface. A function is useful only to those who agree to use the same kind of data structures it accepts as arguments.
Because it hides its data, an object doesn't have this problem. This is one of the principal reasons why classes can be reused more easily than functions.
An object's data is protected and won't be touched by any other part of the program. Methods can therefore trust its integrity. They can be sure that external access hasn't put it in an illogical or untenable state. This makes an object data structure more reliable than one passed to a function, so methods can depend on it more. Reusable methods are consequently easier to write.
Moreover, because an object's data is hidden, a class can be reimplemented to use a different data structure without affecting its interface. All programs that use the class can pick up the new version without changing any source code; no reprogramming is required.

Answer Question

Anonymous