I have the following question:
In package A (a separate dll) I have ClassA.
In Facade (another separate dll) I have a method public IEnumerable GetAll(){}.
In web application I call Facade.GetAll(), but in order to get IEnumerable I need to reference both Facade and package A.
I wonder if it's possible to reference only Facade and at the same time get IEnumerable (for examle constructing interface for ClassA in facade or something like that)?
Otherwise if I reference both dlls I can call GetAll() from ClassA (theoretically or by mistake). But the initial idea was to communicate with business classes through the facade so the end app like website would not know about existence of business classes?
A general approach for this issue is to use a package containing an interface, shared by 1. Your implementation (ClassA) 2. Your Facade (or proxy or whatever replacement you have) 3. the application or class using it.
This way you can never end up using the wrong implementation. And you are more independent of the concrete classes.