Object Oriented Programming and Design Patterns#

Prerequisites

Students should be familiar with opening the Terminal window and creating and navigating files in bash. Students should also have a familiarity with the syntax of the Python programming language.

Workshop Lessons#

Set-Up#

Lesson Title

Questions

Objectives

Setup

  • How do I set up my computer for the lessons?

  • Install anaconda for creating virtual environments.

  • Install lesson requirements in a conda environment.

  • Obtain lesson example materials.

Object Oriented Programming#

Lesson Title

Questions

Objectives

Object Oriented Programming

  • What is Object Oriented Programming?

  • Why should I use Object Oriented Programming?

  • Understand the concepts behind Object Oriented Programming.

Encapsulation

  • What is encapsulation?

  • Why should I use encapsulation in my code?

  • Understand the concept of a Class.

  • Understand the python syntax for Classes.

Abstraction

  • What is Abstraction?

  • Why should I care about Data Abstraction?

  • Understand the concepts behind Data Abstraction.

Inheritance

  • What is Inheritance?

  • Why should I use Inheritance in my code?

  • Understand the concept of a Class.

  • Understand the concepts behind Inheritance.

Abstract Classes

  • What are Abstract Classes?

  • Why should I use Abstract Classes?

  • Understand the concepts behind Abstract Classes.

Polymorphism

  • What is Polymorphism?

  • Understand the concepts behind Polymorphism.

Design Patterns#

Lesson Title

Questions

Objectives

Design Patterns

  • What are Design Patterns?

  • A brief introduction to the types of Design Patterns.

Adapter

  • How can we utilize pre-existing code without modifying it?

  • Learn the Adapter Design Pattern.

  • See an example of the Adapter Design Pattern relavant to the Computational Molecular Sciences domain.

Factory

  • How can a method or class defer instantiation to subclasses?

  • Learn the factory design pattern.

  • See an example of the factory design pattern relavant to the Computational Molecular Sciences domain.

Visitor

  • How to separate the methods from the objects that use them?

  • Understand the visitor design pattern.

  • Show an example of the visitor design pattern relavant to the Computational Molecular Sciences domain.

Factory Second Example

  • How can a method or class defer instantiation to subclasses?

  • Learn the factory design pattern.

  • See an example of the factory design pattern relavant to the Computational Molecular Sciences domain.

Facade

  • How can we simplify the interface to a subsystem?

  • Learn the Facade Design Pattern.

  • See an example of the Facade Design Pattern relavant to the Computational Molecular Sciences domain.

Observer

  • How can an object notify its own state to an open-ended number of objects?

  • Learn the observer design pattern.

  • See an example of the observer design pattern relavant to the Computational Molecular Sciences domain.

Composite

  • How to compose objects into tree structures?

  • How to define a common interface for branches and leaves within a tree?

  • Understand the composite design pattern.

  • Show an example of the composite design pattern relavant to the Computational Molecular Sciences domain.