Design Pattern Examples
Overview of object-oriented design patterns
proxy_class_real.py
Go to the documentation of this file.
8
9from .proxy_interface import IWorkByProxy
10
11
22
23 def __init__(self) -> None:
24 pass
25
26 #-------------------------------------------------
27 # Implementation of the IWorkByProxy interface
28 #-------------------------------------------------
29
30
36 def DoWork(self, someArgument : str) -> str:
37 return "Real class received '{0}'".format(someArgument)
38
39
40#========================================================================
41#========================================================================
42
43
44
52
53
59 def CreateReal() -> IWorkByProxy:
60 return Real_Class()
61
62
65__all__ = ["Real_Classes_Container"]
The real class object that does all the work.
str DoWork(self, str someArgument)
Do some work on a string.
IWorkByProxy CreateReal()
Retrieve a new instance of the real class.
Represents what can be done on the proxy object.