Ask Experts Questions for FREE Help !
Ask
    timoFromMikkeli's Avatar
    timoFromMikkeli Posts: 2, Reputation: 1
    New Member
     
    #1

    Feb 3, 2010, 06:52 AM
    Constructor implementation to the abstract class or not?
    If there are instance variables in the abstract base class I can implement a constructor to this abstract class. However, is it "more right" to implement only "setters" and "getters" to this abstract base class and use those public methods (setters) in my derived class's constructor to initialize the inherited instance variables? Both ways work, but which one is "more to the syntax and semantics"?? I feel uneasy to create a constructor to the abstract base class because it feel unlogical...
    jmd814's Avatar
    jmd814 Posts: 10, Reputation: 2
    New Member
     
    #2

    Feb 4, 2010, 11:04 AM

    From code maintainability and understandability stand points it does make more sense to simply provide getters for the variables that you want to expose from the abstract class.
    timoFromMikkeli's Avatar
    timoFromMikkeli Posts: 2, Reputation: 1
    New Member
     
    #3

    Feb 4, 2010, 12:12 PM
    Quote Originally Posted by jmd814 View Post
    From code maintainability and understandability stand points it does make more sense to simply provide getters for the variables that you want to expose from the abstract class.
    Thank You very much for Your viewpoint!

    Greetings,

    timoFromMikkeli

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

What level or class felony is poss/w intent to distribute class d [ 3 Answers ]

In criminal law is possession with intent to distribute class d "one gram " a major or minor felony? I have this on my record because in mass there was no limit to be charged this way But now it is a civil offence no longer a crime.now that mass law is changed when it comes to marijauna will my...

Calling a constructor outside of the class [ 1 Answers ]

Ok here I am writing a game... when I got to the constructor which is called to create a character, it doesn't work. It keeps saying symbol not found when I in fact did have the same file name and parameter parsed when I called it... so what's the deal? public class SCRpg{ public static void...

Change implementation [ 1 Answers ]

What are the main models and methods for managing change effectively and their strengths and weaknesses

Constructor Design [ 1 Answers ]

When you create a class you must create a constructor, right? so should you create more than one constructor for every class you create? 1) no argument constructor to initialize ALL private values in case the user doesn't & 2) all other possible variations depending on what the user may...

Implementation Bleeding [ 3 Answers ]

Hi I Am 24 Years Of Age And Desperate To Get Pregnant I Had A Period On The 3rd Of Dec It Lasted 3 Days My Periods Are Very Regular Never Missed A Period Or Ever Had A Late Period. Today On The 25th Of December I Think I Have Had Impementation Bleading Is It To Early For Me To Get Pregnant My...


View more questions Search