CodePudding user response:
And to think about why you want to reference in the view the BLLCodePudding user response:
Independent a public library for the BLL and View call. It'll be okCodePudding user response:
Write an interface, back to the parametersCodePudding user response:
Since the BLL business logic as a separate project, is that you mean the BLL business logic can be used to different interface, the view can refer to the BLL, other mobile terminal app, winform client can use the BLL, that your problem, there is a class file to the BLL call view, what is called the view project right?If a beginner is not aware of the problem, need not hierarchical, it is a question of the architecture level, by defining interfaces, passing view instance can really realize your ideas, but should not effect you want
CodePudding user response:
The ClassA inherit an interface IClassA,Then in the ClassB IClassA a=new ClassA ();
CodePudding user response:
To avoid this situation,The best method is to don't declare a global variable in the class,
But within the method, called which classes, which class is instantiated,
CodePudding user response:
This is typical of dependence, A reference to B, said A relies on B, then B references A, in turn circular dependencies are formed, in the software design should avoid circular dependencies, otherwise more project is to explode,CodePudding user response:
That's the way to use the parameter passing, instead of using the global variables,If have to Shared global variables, it is another responsibility of public library,
CodePudding user response:
Architecture did not want to good, incredibly reference each otherCodePudding user response:
Will building blocks, a, b is theAnd you come to a, b is next