|
-
May 12th, 2006, 05:08 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2.0]Sealed classe Vs Abstract class concept question
Howdy all,
I have understood from my readings that Abstract class can't be instantiated but can be derived by other classes.
on the other hand, a sealed class, can be instantiated but not be derived by another class (means a sealed class can't be a base class at all).
Being new to OOPS and C# programming, when ever I read any OOPS concept I wonder under what circumstances, in the real world, they would use.
I can imagine, where, abstract class concept can and should be implemented.
But, where will the Sealed class be used?
For example, I have a situation where I need to write some classes (grouped in a namespace) in a project which can be used by another department in the company. Kind of framework library. I don't want any one to inherit from this library (I mean classes in this namespace).
Should I make all these classes in this library as Sealed?
Or should I make them Static? that way the users (programmers) don't have to actually instantiate an object of these common classes to use their methods.
Which method I should be choosing.
Abstract/Sealed/Static??
thanks
nath
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|