Click here to Skip to main content
15,890,609 members
Home / Discussions / C#
   

C#

 
GeneralRe: controling items in a dialog from another dialog Pin
S. Senthil Kumar11-May-05 7:29
S. Senthil Kumar11-May-05 7:29 
GeneralFile Types Editor in Setup project (Visual Studio) Pin
WujekSamoZlo11-May-05 4:06
WujekSamoZlo11-May-05 4:06 
GeneralWinform User Controls Pin
skrishnasarma11-May-05 3:35
skrishnasarma11-May-05 3:35 
GeneralGraphics In C# Pin
liormin11-May-05 3:34
liormin11-May-05 3:34 
GeneralRe: Graphics In C# Pin
S. Senthil Kumar11-May-05 4:04
S. Senthil Kumar11-May-05 4:04 
GeneralRe: Graphics In C# Pin
Polis Pilavas11-May-05 4:20
Polis Pilavas11-May-05 4:20 
GeneralRe: Graphics In C# Pin
Snowjim11-May-05 7:02
Snowjim11-May-05 7:02 
GeneralDesign problem Pin
Pedro S Ferreira11-May-05 3:22
Pedro S Ferreira11-May-05 3:22 
Hi,

I'm working in a class library project and I'm trying to design the code in the best way possible.

I have an abstract class that represents the header of one file defined like this:

<br />
public abstract class FileHeader<br />
{<br />
 // +/- 10 private fields with header information<br />
<br />
  protected FileHeader()<br />
  {<br />
  }<br />
<br />
 //Readonly properties for all private fields<br />
<br />
 public abstract void Open(string filePath);<br />
}<br />


Now the question is:

My header class should be readonly (cannot set properties values from outside), but my derived classes should be able to set the fields in their implemetation of Open method.
According to the Design Guidelines for Class Library Developers from MSDN, we shouldn't leave protected fields in base classes, so the only way I can see is to add a protected method to set each field... and that don't sounds good...

Could anyone give me some ideas here?

Thanks! and sorry for the long post Big Grin | :-D
GeneralRe: Design problem Pin
S. Senthil Kumar11-May-05 3:59
S. Senthil Kumar11-May-05 3:59 
GeneralMy C# App Protection Pin
Member 271608811-May-05 2:33
Member 271608811-May-05 2:33 
GeneralRe: My C# App Protection Pin
Robert Rohde11-May-05 5:38
Robert Rohde11-May-05 5:38 
GeneralRe: My C# App Protection Pin
Member 271608811-May-05 5:49
Member 271608811-May-05 5:49 
GeneralWhich is the fastest pattern matching algorithm Pin
tommazzo11-May-05 2:09
tommazzo11-May-05 2:09 
GeneralRe: Which is the fastest pattern matching algorithm Pin
leppie11-May-05 6:47
leppie11-May-05 6:47 
GeneralRe: Which is the fastest pattern matching algorithm Pin
tommazzo12-May-05 9:47
tommazzo12-May-05 9:47 
Generalthree final questions Pin
snouto11-May-05 1:50
snouto11-May-05 1:50 
GeneralDecimal precision Pin
Anonymous11-May-05 1:49
Anonymous11-May-05 1:49 
GeneralRe: Decimal precision Pin
S. Senthil Kumar11-May-05 2:15
S. Senthil Kumar11-May-05 2:15 
GeneralRe: Decimal precision Pin
Anonymous11-May-05 2:18
Anonymous11-May-05 2:18 
GeneralRe: Decimal precision Pin
S. Senthil Kumar11-May-05 3:11
S. Senthil Kumar11-May-05 3:11 
GeneralRe: Decimal precision Pin
Dave Kreskowiak11-May-05 6:38
mveDave Kreskowiak11-May-05 6:38 
GeneralRe: Decimal precision Pin
Dave Kreskowiak11-May-05 6:36
mveDave Kreskowiak11-May-05 6:36 
QuestionHow to prevent PrtScn? Pin
Marc Clifton11-May-05 1:42
mvaMarc Clifton11-May-05 1:42 
AnswerRe: How to prevent PrtScn? Pin
snouto11-May-05 1:54
snouto11-May-05 1:54 
GeneralRe: How to prevent PrtScn? Pin
Dead Skin Mask11-May-05 3:40
Dead Skin Mask11-May-05 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.