Fans of Template Method with protected variable?
From: Alex Kay (me2_at_spam.not)
Date: 06/24/04
- Next message: Phlip: "Re: Fans of Template Method with protected variable?"
- Previous message: r song: "Implement Mapper Registry PofEAA"
- Next in thread: Phlip: "Re: Fans of Template Method with protected variable?"
- Reply: Phlip: "Re: Fans of Template Method with protected variable?"
- Reply: Daniel T.: "Re: Fans of Template Method with protected variable?"
- Reply: Robert C. Martin: "Re: Fans of Template Method with protected variable?"
- Reply: Roger L. Cauvin: "Re: Fans of Template Method with protected variable?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Jun 2004 00:47:54 GMT
Hi folks,
After many years of OOP and countless applications of the Template Method
pattern where I always had private object variables and public accessors,
I've recently started using protected variables in the super class instead.
The motivation is driven by convenience (less typing) and development speed,
the subclasses get what they want one way or the other.
The problem is I now feel cheap and dirty, could the more convenient
technique be as good as the fully encapsulated counterpart? So I wanted to
ask when you guys implement this pattern do you do it with private variables
plus public accessors or do you just use protected variables? Has anyone
been stung by the protected variable route?
Thanks in advance
Alex K
- Next message: Phlip: "Re: Fans of Template Method with protected variable?"
- Previous message: r song: "Implement Mapper Registry PofEAA"
- Next in thread: Phlip: "Re: Fans of Template Method with protected variable?"
- Reply: Phlip: "Re: Fans of Template Method with protected variable?"
- Reply: Daniel T.: "Re: Fans of Template Method with protected variable?"
- Reply: Robert C. Martin: "Re: Fans of Template Method with protected variable?"
- Reply: Roger L. Cauvin: "Re: Fans of Template Method with protected variable?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]