Design Pattern Examples
Overview of object-oriented design patterns
Program Class Reference

Contains all the top-level Design Pattern Examples to match C#. More...

Collaboration diagram for Program:
Collaboration graph

Classes

class  Exercise
 Represents a single exercise or example for a design pattern. More...
 
class  Options
 Represents the command line options provided to the program, if any. More...
 

Public Member Functions

def Help (self, list[Exercise] exercises)
 Helper method to show usage information for this program.
 
def ShowVersion (self)
 Helper method to show just the version of the application.
 
bool ParseOptions (self, args, Options options, exercises)
 Helper method to parse the given options and store the results in the given Options structure.
 
def Run (self, args=None)
 Run the specified examples.
 

Detailed Description

Contains all the top-level Design Pattern Examples to match C#.

Definition at line 32 of file program.py.

Member Function Documentation

◆ Help()

def Help (   self,
list[Exercise exercises 
)

Helper method to show usage information for this program.

Parameters
exercisesList of Exercise objects for which to show the names.

Definition at line 68 of file program.py.

Referenced by Program.ParseOptions().

◆ ParseOptions()

bool ParseOptions (   self,
  args,
Options  options,
  exercises 
)

Helper method to parse the given options and store the results in the given Options structure.

Displays help if requested and returns False.

Returns
True if options are valid and help was not displayed; otherwise, returns False. In this case, False is returned only if help display is requested (options are not validated).

Definition at line 101 of file program.py.

References Program.Help(), and Program.ShowVersion().

Referenced by Program.Run().

◆ Run()

def Run (   self,
  args = None 
)

Run the specified examples.

Parameters
argsCommand line arguments.

Definition at line 121 of file program.py.

References Program.ParseOptions().

◆ ShowVersion()

def ShowVersion (   self)

Helper method to show just the version of the application.

Definition at line 89 of file program.py.

Referenced by Program.ParseOptions().


The documentation for this class was generated from the following file: