[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-140673-en":3,"doc-seo-140673-105":30,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},140673,13056712833777,"Paura","https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0",6,"Technology","Freecell/Solitaire - Software Design Inheritance Guidelines","Freecell/Solitaire overview combined with software design notes focused on inheritance and polymorphism in OOP. The material guides how to identify game objects and responsibilities (cards, piles, behaviors), then map those concepts into class structures. It explains two key views of inheritance—sharing interface commonality versus sharing implementation—along with runtime binding and late dispatch. C++-specific guidelines cover ABCs with pure virtual functions, virtual destructors, inheritance vs layering/aggregation, and heuristics to avoid flawed hierarchies, excessive depth, and misuse of inheritance.","Freecell/Solitaire overview  \nz What are the use cases?  \n¾ How does customer use the program?  \n¾ What are scenarios as the game develops?  \n¾ What parts of the \"standard version\" are good/bad?  \n¾ What options might we want to have?  \nz How will we design the program?  \n¾ Brainstorm classes  \n¾ Develop and test  \n¾ Rethink design and use cases  \n¾ Develop and test ¾    \nSoftware Design 2.1  \n\n| Inheritance (language independent)\u003Cbr>z First view: exploit common interfaces in programming\u003Cbr>¾ iterator, C++ function objects\u003Cbr>• Iterators in STL/C++ share interface by convention/templates\u003Cbr>¾ Implementation varies while interface stays the same\u003Cbr>z Second view: share code, factor code into parent class\u003Cbr>¾ Code in parent class shared by subclasses\u003Cbr>¾ Subclasses can override inherited method\u003Cbr>• Can subclasses override and call?\u003Cbr>z Polymorphism/late(runtime) binding (compare: static)\u003Cbr>¾ Actual function called determined when program runs, not when program is compiled\u003Cbr>Software Design | 2.3 |\n| --- | --- |\n\nFreecell classes  \nz What are the classes in the program? Behaviors?  \n¾ Look for objects, how do they act? Nouns? Verbs  \nz What about a Card class? Behaviors/Responsibilities?  \n¾ State? Mutable?  \n¾ Comparison? Other games?  \n¾ Who creates cards? Relevant to solitaire? Other games?  \nz What about CardPile classes, similarities? Differences?  \n¾ FreeCell, AcePile, DrawPile,…  \n¾ Other card games?  \nSoftware Design 2.2  \nInheritance guidelines in C++  \nz Inherit from Abstract Base Classes (ABC)  \n¾ one pure virtual function needed (=0)  \n• Subclasses must implement, or they’re abstract too  \n¾ must have virtual destructor implemented  \n• can have pure virtual destructor with an implementation, but this is special case, not normally needed [force ABC]  \nz Avoid protected data, but sometimes this isn’t possible  \n¾ data is private, subclasses have it, can’t access it  \n¾ keep protected data to a minimum  \nz Single inheritance, assume most functions are virtual  \n¾ multiple inheritance ok when using ABC, problem with data in super classes  \n¾ virtual: some overhead, but open/closed principle intact  \nSoftware Design 2.4  \nInheritance Heuristics  \nz A base/parent class is an interface  \n¾ Subclasses implement the interface  \n• Behavior changes in subclasses, but there’s commonality  \n¾ The base/parent class can supply some default behavior  \n• Derived classes can use, override, both  \n¾ The base/parent class can have state  \n• Protected: inherited and directly accessible  \n• Private: inherited but not accessible directly  \n¾ Abstract base classes are a good thing  \nz Push common behavior high up in an inheritance hierarchy  \nz If the subclasses aren’t used polymorphically (e.g., through a pointer to the base class) then the inheritance hierarchy is probably flawed  \nSoftware Design 2.5  \nInheritance and Layering/Aggregation  \nz Layering (or aggregation) means “uses via instance variable”  \n¾ Use layering/attributes if differences aren’t behavioral  \n¾ Use inheritance when differences are behavioral  \nz Consider Student class: name, age, gender, sleeping habits  \n¾ Which are attributes, which might be virtual methods  \nz Lots of classes can lead to lots of problems  \n¾ It’s hard to manage lots of classes in your head  \n¾ Tools help, use speedbar in emacs, other class browsers in IDEs or in comments (e.g., javadoc)  \nz Inheritance hierarchies cannot be too deep (understandable?)  \nSoftware Design 2.7  \nInheritance Heuristics in C++  \nz One pure virtual (aka abstract) function makes a class abstract  \n¾ Cannot be instantiated, but can be constructed (why?)  \n¾ Default in C++ is non-virtual or monomorphic  \n• Unreasonable emphasis on efficiency, sacrifices generality  \n• If you think subclassing will occur, all methods are virtual  \n¾ Must have virtual destructor, the base class destructor (and constructor) will be called  \nz We use public inheritance, models is-a relationship  \n¾ Private inheritance means is-implemented-","cbCain7XRaP2YhzV","https://ap.wps.com/l/cbCain7XRaP2YhzV","pdf",88992,1,2,"English","en",105,"# Freecell/Solitaire overview\n## Use cases and design questions\n## Inheritance (language independent)\n## Freecell classes\n## Inheritance guidelines in C++\n## Inheritance heuristics\n## Inheritance and layering/aggregation\n## Inheritance guidelines (Riel)\n## Inheritance heuristics in C++","[{\"question\":\"How should customer use cases and scenarios be captured for Freecell/Solitaire?\",\"answer\":\"List program use cases, then ask how a customer uses the game as it develops, what parts of the standard version are good or bad, and what options may be needed. Use this to drive the design process and iteration cycles.\"},{\"question\":\"What two views of inheritance are described in the notes?\",\"answer\":\"First, inheritance exploits common interfaces by sharing an interface while varying implementation. Second, it shares code by factoring common behavior into a parent class while allowing subclasses to override inherited methods.\"},{\"question\":\"What are the main C++ inheritance guidelines emphasized?\",\"answer\":\"Use abstract base classes with pure virtual functions, ensure the base has a virtual destructor, avoid excessive protected data, prefer single inheritance with most functions virtual for polymorphic design, and use public inheritance for is-a relationships while applying layering/aggregation when behavior differences are not behavioral.\"}]","Freecell/Solitaire - Software Design Inheritance Guidelines | PDF",1787595696,5,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":28},"freecellsolitaire-software-design-inheritance-guidelines","",{"@graph":36,"@context":84},[37,53,67],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,47,50],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":21},"https://docshare.wps.com/document/","Document",{"item":48,"name":12,"@type":43,"position":49},"https://docshare.wps.com/document/technology/",3,{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/freecellsolitaire-software-design-inheritance-guidelines/140673/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-08-24",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"How should customer use cases and scenarios be captured for Freecell/Solitaire?","Question",{"text":74,"@type":75},"List program use cases, then ask how a customer uses the game as it develops, what parts of the standard version are good or bad, and what options may be needed. Use this to drive the design process and iteration cycles.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What two views of inheritance are described in the notes?",{"text":79,"@type":75},"First, inheritance exploits common interfaces by sharing an interface while varying implementation. Second, it shares code by factoring common behavior into a parent class while allowing subclasses to override inherited methods.",{"name":81,"@type":72,"acceptedAnswer":82},"What are the main C++ inheritance guidelines emphasized?",{"text":83,"@type":75},"Use abstract base classes with pure virtual functions, ensure the base has a virtual destructor, avoid excessive protected data, prefer single inheritance with most functions virtual for polymorphic design, and use public inheritance for is-a relationships while applying layering/aggregation when behavior differences are not behavioral.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,108,111,116,121,126,129,133],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":21,"doc_module":4,"doc_module_name":46,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":29,"doc_module":4,"doc_module_name":46,"category_name":105,"show_sort_weight":106,"slug":107},"Comic",60,"comic",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":109,"slug":110},50,"technology",{"id":112,"doc_module":4,"doc_module_name":46,"category_name":113,"show_sort_weight":114,"slug":115},7,"Healthcare",40,"healthcare",{"id":117,"doc_module":4,"doc_module_name":46,"category_name":118,"show_sort_weight":119,"slug":120},8,"Research & Report",30,"research-report",{"id":122,"doc_module":4,"doc_module_name":46,"category_name":123,"show_sort_weight":124,"slug":125},9,"Religion & Spirituality",20,"religion-spirituality",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":127,"show_sort_weight":124,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":46,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":46,"category_name":135,"show_sort_weight":29,"slug":136},19,"General","general"]