Pathway Introduction: Information Technology

Pathway Introduction: Information Technology

Inheritance Basics Code reuse through subtyping Inheritance : What is It Inheritance Technical mechanism for code reuse Conceptual design mechanism : is-a relationship

Inheritance Terminology Inheritance : derive a class from another class Terminology Parent or Base class Derived or Child class UML Arrow from derived to parent class

Inheritance Heirarchies Multiple classes can derive from one base Can derive from a class that is derived Conceptual Model How to visualize inheritance:

Apple consists of a Fruit object and an Apple wrapper Wrapper can add new features / hide existing ones Fruit Other Code Apple

Geometric Object Example Function also available in Circle & Rectagle Circle & Rectangle could use toString()

but chose to override Circle Interactions Calls on a derived class handled by code there if possible, otherwise by parent class Geometric

Object Circle Generic Programming A derived class can be treated as parent type: Circle Code

State inheritance with : public ParentClass Do not redeclare parent members unless overriding them Using Inherited Members Derived class does NOT have access to private

members of parent: Using Inherited Members Derived class does NOT have access to private members of parent Must use public interface to access Protected Access

Private Only accessible in this class Protected Access Private Only accessible in this class

Public Accessible anywhere Protected Access Private Only accessible

in this class Public Accessible anywhere Protected Accessible in this

class and any subclasses Access Summary Private Member variables Helper functions no one else should use

Protected Member variables it is reasonable for child classes to work with Functions you only want subclasses to use Public Functions Constants

Recently Viewed Presentations

  • End to End Workflow Monitoring Panorama 360 George

    End to End Workflow Monitoring Panorama 360 George

    Darshan. Darshan is an HPC lightweight application-level I/O profiling tool that captures statistics on the behavior of HPC I/O operations. It captures data for each file opened by the application, including I/O operation counts, common I/O access sizes, cumulative timers,...
  • WTO and RTA Dispute Settlement: Is it Possible to Avoid ...

    WTO and RTA Dispute Settlement: Is it Possible to Avoid ...

    2. More powerful jurisdictional clauses? Choice of forum clause cum electa una via? Good practice, but may not solve all of the problems RTA clauses by which WTO issues are to be solved only in WTO? Not very effective Exclusive...
  • Promotion and promotional Mix

    Promotion and promotional Mix

    THE CONCEPT OF PROMOTIONAL MIX. Promotion. any form of communication a business or organization uses toinform, persuade, or remindpeople about its products or improve its public image. Promotional Mix. the combination of the different types of promotion a business or...
  • Assessment Challenges, Contradictions, and Inequities: An Analysis of

    Assessment Challenges, Contradictions, and Inequities: An Analysis of

    Analysed data from EOIS-CaMS (2013-2014) School boards represented the overall provincial trends when we looked at EOIS-CaMS data and hugged the middle between community programs and colleges. In addition, your representation in the study was nicely aligned with the percentage...
  • Clinical Conundrums in Cancer Chemoprevention: What Should You

    Clinical Conundrums in Cancer Chemoprevention: What Should You

    ASA Use and the Incidence of Cancer. Other cancers: Meta-analyses of numerous RCTs. Daily aspirin therapy: Was associated with a reduction in all cancers (up to 12% relative risk reduction) Benefit after 4 years, independent of age, gender, tobacco use...
  • Welcome to Scholarship/Financial Aid Information Night

    Welcome to Scholarship/Financial Aid Information Night

    college, scholarship and financial aid information
  • PDS Partnerships: Promoting Teacher Leaders

    PDS Partnerships: Promoting Teacher Leaders

    Thanks to DePaul University Searle Funds at the Chicago Community Trust McDougal Family Foundation PDS Partnerships: Promoting Teacher Leaders Ms. Rachel Gemo, Principal Ms. Nancy Meskel, 1st grade teacher St. Benedict School, Chicago, IL A DePaul University PDS Partner Presentation...
  • Vocabulary Unit #8

    Vocabulary Unit #8

    N.—an armored or protective glove; a challenge; an ordeal; two lines of armed men with weapons with which to beat a person forced to run between them. Synonym: dare, punishment. In the Middle Ages, a knight threw down his ....