code_junkie

Is Inheritance really needed?

Nov 12th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. class Point( object ):
  2. # some set of features: attributes, methods, etc.
  3.  
  4. class PointWithMass( Point ):
  5. # An additional feature: mass.
  6.  
  7. public abstract class GeneralPresentation
  8. {
  9. public GeneralPresentation()
  10. {
  11. MenuPages = new List<Page>();
  12. }
  13. public IEnumerable<Page> MenuPages { get; set; }
  14. public string Title { get; set; }
  15. }
  16.  
  17. public class IndexPresentation : GeneralPresentation
  18. {
  19. public IndexPresentation() { IndexPage = new Page(); }
  20. public Page IndexPage { get; set; }
  21. }
  22.  
  23. public class InsertPresentation : GeneralPresentation
  24. {
  25. public InsertPresentation() {
  26. InsertPage = new Page();
  27. ValidationInfo = new PageValidationInfo();
  28. }
  29. public PageValidationInfo ValidationInfo { get; set; }
  30. public Page InsertPage { get; set; }
  31. }
Add Comment
Please, Sign In to add comment