AppBuilder class
hello there iam currently trying to think of a solution so i can make myself a AppBuilder without needing to reference all projects directly
basicly i have a Program.cs from a wpf app in Project B but in project A i want to be able to say something like
how could that be done?
15 Replies
would the
Use
extension method pattern work?
in project B:Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
in project A:
builder.AddWpfApp();
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
its not only about logging its just as an example
project B gets to control what gets registered
even though project A actually does the registration
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
this would be in project B then right?
never heard of that
it's what you see a lot of libraries do
like automapper has an extension method
AddAutomapper()
which handles all the registration for you
uhh, the other way around actually i think, now that i re-read your post
project B is the app you're actually running, right
and project A is some kind of library or whatever?
in that case you would have an extension method with AddSingleton<LoggerForProjectA>()
in project A somewhere
and call the extension method in project Bthe entire project is a 3 Layer wpf application having 3 main parts UI Core and HostProcess
HostProcess is the first thing that starts wich boots up the entire application and launches the Launcher wpf project
the wpf project might need some parts of core then wich is a class library
same with other ui components
one other side part we also have which is the plugin managment
like for logging we make a own project wich implements our plugin structure and load it in with the host process before the wpf apps start
sounds like it'll still work then yeah
iam refactoring the entire solution architecture for the 3rd time now as the team still isnt happy with it xd
Have the bootstrapper be separate from the core so it can reference projects directly
Or include it in the outermost layer
@Dropps
its not having a bootstrapper its not a web app
Doesnt matter, if you are encountering circular references, you need to change something
I use bootstrapper as a generic term to describe the code that initializes and starts your app
It should be in your presentation layer
Or separate from the three distinct layers