[Show all top banners]

RadhaKrishna
Replies to this thread:

More by RadhaKrishna
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 benefits of proper inheritance

[Please view other pages to see the rest of the postings. Total posts: 27]
PAGE: <<  1 2  
[VIEWED 22205 TIMES]
SAVE! for ease of future access.
The postings in this thread span 2 pages, View Last 20 replies.
Posted on 11-12-15 2:23 AM     [Snapshot: 100]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

COPIED FROM GOOGLE SEARCH:

Inheritance Advantages and Disadvantages

Advantages:-

One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be refactored to move the common code up to a mutual superclass. This also tends to result in a better organization of code and smaller, simpler compilation units.

Inheritance can also make application code more flexible to change because classes that inherit from a common superclass can be used interchangeably. If the return type of a method is superclass

Reusability -- facility to use public methods of base class without rewriting the same
Extensibility -- extending the base class logic as per business logic of the derived class
Data hiding -- base class can decide to keep some data private so that it cannot be altered by the derived class

Overriding--With inheritance, we will be able to override the methods of the base class so that meaningful implementation of the base class method can be designed in the derived class.

Disadvantages:-

1.One of the main disadvantages of inheritance in Java (the same in other object-oriented languages) is the increased time/effort it takes the program to jump through all the levels of overloaded classes. If a given class has ten levels of abstraction above it, then it will essentially take ten jumps to run through a function defined in each of those classes

2.Main disadvantage of using inheritance is that the two classes (base and inherited class) get tightly coupled.
This means one cannot be used independent of each other.

3. Also with time, during maintenance adding new features both base as well as derived classes are required to be changed. If a method signature is changed then we will be affected in both cases (inheritance & composition)

4. If a method is deleted in the "super class" or aggregate, then we will have to re-factor in case of using that method.Here things can get a bit complicated in case of inheritance because our programs will still compile, but the methods of the subclass will no longer be overriding superclass methods. These methods will become independent methods in their own right.


Inheritance offers the following advantages --
Developement model closer to real life object model with hierarchical relationships
Reusability -- facility to use public methods of base class without rewriting the same
Extensibility -- extending the base class logic as per business logic of the derived class
Data hiding -- base class can decide to keep some data private so that it cannot be altered by the derived class
 
Posted on 11-13-15 4:56 PM     [Snapshot: 688]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

Cp21,
Can I tell you something? Calm yourself down and listen to me. I was the one who initiated all the fights here so you can say anything to me. But, Radhkrishna genuinely helped you and you are giving him all this in return. I strongly believe that this isn't right and appropriate, and you owe an apology to Radhakrishna.
 
Posted on 11-13-15 5:02 PM     [Snapshot: 710]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Radhakrisn: I know you would like to give a genuine advise and easiest thing is to advise. And very few people take it seriously , rest will see it negatively and may take it is as a parental advise. 
I see a lot new thread because of your advise?

Last edited: 14-Nov-15 07:30 PM

 
Posted on 11-13-15 5:42 PM     [Snapshot: 761]     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

magorkhe1, the new threads are because of cp21's ego, immaturity and anger management issues.

Radhakrishna and Pharsi, it's not worth arguing with chandra prakash. So, ignore him and have a nice weekend.
 
Posted on 11-13-15 5:45 PM     [Snapshot: 772]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

@ magorke1:

It is fine buddy... I can understand what you are saying. Most probably you did not get from where it begin. It is not today's story alone.
This little bastard cp21, who is a nepali, says that he does not know nepali... and starts abusing genuine person who helps him with his stupid lazy ass questions which he can easily find googling it. And when somebody says him something, he starts abusing that person. And he has been doing that for a long time.
He thinks that he is studying in IT field, most probably would always call him as an ENGINEER, but in reality is sucking cheap ass dhoti's dick in a consultancy and shows the manner of a cheap ass third class individual by abusing and disrespecting all.
Enough is enough for this bastard child.
Whatever advice it is, we are not telling him how to live his damn retarded fucking life. We are just asking him to pay some respect and have some manners.
But it is just an another day to him, I know that. Few days back, he was fighting with somebody else, today he started bullshitting with me and tomorrow, you may the person, who know.
Thanks for your advice though. Will keep in mind.

 
Posted on 11-13-15 6:21 PM     [Snapshot: 798]     Reply [Subscribe]
Login in to Rate this Post:     2       ?     Liked by
 

cp21 should have some respect to people who genuinely help others in sajha, like Mr. RadhaKrisha. No body is paying anyone for help or their valuable time giving suggestions. It's for free and comes only because we Nepalis have lots of empathy and at one time we all have been through the same situations. cp21 should have respect for RadhaKrishna ji. He has genuinely helped lots of people in sajha and always give honest answers. If he's telling you to study you should take it as a suggestion from a big brother and maybe in your best interest to do so.
 
Posted on 11-13-15 6:34 PM     [Snapshot: 808]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

CP भाई , गूगल मा एउटा click गरेर पाइने उत्तर लाइ तिमि ले येहा पोस्ट गरेउ तै पनि अरु ले उत्तर दिए | धन्यबाद दिन त कता हो कता हो उल्टो गालि गर्न मा उत्र्रेउ ! लाज लाग्दैन भाई ?
*भाई किन भनेको भन्लाउ , तिम्रो बोलि चाली कुरो गरे को ताल हेरेर दाइ त के मित्र नि भन्न मन लागेन !
 
Posted on 11-13-15 7:08 PM     [Snapshot: 848]     Reply [Subscribe]
Login in to Rate this Post:     1       ?     Liked by
 

Hey Chandra Prakash - Fuck You.
 



PAGE: <<  1 2  
Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 30 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
मन भित्र को पत्रै पत्र!
काेराेना सङ्क्रमणबाट बच्न Immunity बढाउन के के खाने ?How to increase immunity against COVID - 19?
TPS Work Permit/How long your took?
Guess how many vaccines a one year old baby is given
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
Travelling to Nepal - TPS AP- PASSPORT
Morning dharahara
Another Song Playing In My Mind
Travelling on TPS advance travel document to different country...
Are you ready to know the truth?
Alert: Turbo Cancers: A Rising Global Threat
Does the 180 day auto extension apply for TPS?
ढ्याउ गर्दा दसैँको खसी गनाउच
1974 AD Pinjadako Suga Remixed
Susta Susta Degree Maile REMIXED version
Elderly parents travelling to US (any suggestions besides Special Assistance)?
कल्लाई मुर्ख भन्या ?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters