Re: Inheritance question

Tech-Archive recommends: Speed Up your PC by fixing your registry



Peter,

I do define the string in each of the derived classes as well as the base. But the property is
defined in the base class, as you suggested, which works perfectly. I am sorry if I gave you the
impression that I was putting the keywords in the base class.

I certainly do not want to appear as a Subversion expert - I just am trying to learn it. If a
module under source control contains a keyword, it is expanded in that module when it is committed
to the repository.

Flomo
--



Peter Duniho wrote:

On Fri, 25 May 2007 13:00:42 -0700, Flomo Togba Kwele <Flomo@xxxxxxxxxxxxxxxx> wrote:

The reason I have to define the string again in the derived class is that its value gets
changed each time it is checked in.

I don't see how you arrive at that conclusion. Why does the fact that the value gets change
affect where you have to declare the field that contains the string?

It's value is not a function of the IDE, but an outside event. The
source control changes the code where it sees keywords (e.g, $Date$ or $Revision$) and
expands it ($Date$) to "$Date: 2007-05-25 10:57:56 -0700 (Fri, 25 May 2007) $" (for example).

Why does that prevent you from including the keywords in the derived class rather than the base
class?

There may well be some limitation that I don't understand. I haven't used Subversion so I don't
know exactly what its rules are. But given the rules you've stated so far in this thread, the
code I posted should work fine.

If Subversion only looks for its keywords in field initializations that are part of the field
declaration, I could see that as being a problem. But you haven't suggested that's the case,
nor do I see why it would be.

Pete
.



Relevant Pages

  • Re: Inheritance and Interfaces
    ... Talk about having a "duh" moment. ... >You only need to implement INotifyPropertyChanged in the base class, ... > Public Property NameAs String ... >The Overridable Sub OnPropertyChanged allows derived classes to raise ...
    (microsoft.public.dotnet.languages.vb)
  • Re: a sharde member variable in base class
    ... > Is this variable shared among all of the instances of the base class ... > and derived classes? ... > Shared Function GetId() as String ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OT - Things I want in VS and C#
    ... me a lot of time if when I override a method, the documentation from ... the base class would come up automatically. ... Even better, keywords that ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Inheritance question
    ... defined in the base class, as you suggested, which works perfectly. ... impression that I was putting the keywords in the base class. ... I'm just saying to initialize it in the constructor of the derived class. ...
    (microsoft.public.dotnet.framework)
  • Re: Not pure virtual functions and mixing virtual and non virtual methods
    ... Should I call base class implementation or not? ... But doing the above assumes that one answer is good for all, that all derived classes will want the base class method called in the same way. ... More generally, the way I see it, if you combine invariant implementation with variant parts, you have no elegant way to change the variant part. ... Following them will remove all inheritance relationships. ...
    (comp.object)