Hello everyone,
I am designing an application which could be treated as a framework application to host other components, e.g. functions like component life cycle management and delegate from client to call the components.
Now I have two design patterns, and I want to ask for advice about which one is better and why.
Design pattern 1, using interface, for example, let client application impement interface, which contains method called Initialization, and my application framework call Initialization method when I want to initialize a component;
Design pattern 2: using event for example, OnIntialize event, client application register event handler (callback), and when my application framework wants to initialize a component, I will send OnInitialize event.
Any advice?
thanks in advance,George