I have a blazor project that has a sperate Webapp UI and a mobile app UI utilising blazor hybrid principals, they share multiple components that display some data and allow actions to be performed on that data.
On ONe of the components both UI's use 95% of the actions for that component but there is 5% that is only used by the Webapp and there is absolutley no need for these actions in the mobile app.
All these actions are performed by a command factory class that is injected into the component, the factory know how to do 100% of the commands and uses injected services to perform most of these actions.
The Problem is the 5% of actions that the Mobile doesn't need are on an injected service that the mobile app just doesn't need and has no implementation for.
So my question is how do i split this?
Currently if I don't inject the dependant service from the mobile app (again the mobile app will never need this service or it's actions) the mobile app errors when loading the component.
I don't particularily want a different component or a different factory class for each UI as they share 99% of the layout and 95% of the commands so there is massive amounts of duplication in either of those scenarios, but I also don't want to have to create a service in the mobile app that i can inject as i shouldn't need to implement a service i have 0 need for?
I'm struggling with this so any advice would be greatly appreciated.
I though about implementing a different factory for the Mobile App that doesn't have the dependancy but then I'm going to end up with 2 factories that essentially call the same code which is a nightmare for mainteance and teh same goes for the component??