I wonder if creating an object outside of facade providing its needed information and than putting it into a facade breaks the pattern?
explanation : usually the objects of the facade are created into the facade itself, however I want to create the object outside of the facade and than pass them into it. And I wonder if its a bad thing to do.
Example:
class A:
def __init__(self , a ,b, c):
self.a = a
self.b = b
self.c = c
def do_something_a(self):
print(self.a, self.b, self.c)
class B:
def __init__(self, d, e, f):
self.d = d
self.e = e
self.f = f
def do_something_b(self):
print(self.d, self.e, self.f)
class Facade:
def __init__(self, class_a, class_b):
self.class_a = class_a
self.class_b = class_b
def do(self):
self.class_a.do_something_a()
self.class_b.do_something_b()
a = A(1,2,3)
b = B(3,4,5)
f = Facade(a,b)
f.do()