Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
We are working on a software platform that may be used under Desktop and/or Web. The business logic is strictly seperated from UI, thus can be used unchanged. We try to construct an UI framework that do most UI building work automatically. For example, the API may looks like that:

C#
MenuService m = UIFramework.GetMenuService();
m.AddMenu("File\Open", OpenCallback);
m.AddMenu("File\New", NewCallback);

DialogService d = UIFramework.GetDialogService();
d.ShowDialog("PropertySetting", context);


The MenuSerivce can be construct more esaily, but the DialogService is difficult since some control unique for Winform, WPF and/or ASP.NET should be supported. We think some code branch should be used, but still looking for a elegant solution.

May anyone give some advise? Thanks a lot!
Posted
Updated 14-Jan-16 9:57am
v2
Comments
Sergey Alexandrovich Kryukov 14-Jan-16 17:01pm    
I doubt it; it would make little sense, due to dramatically different architectural models.
But nothing prevents you from having a separate project(s) which covers only business logic and/or other aspects unrelated to UI. It could create an assembly re-used in different types of UI. The UI abstraction layer can be done only to the extent abstracted from event handling. The event handling and collaboration between events and presentation would be problematic, because of principle difference in Web applications: stateless protocol, handling of events partly in client side and partly on server side, different languages and platforms used (browser as platform vs .NET), severe performance consequences of related solutions, and so on...
—SA
Member bi-dongliang 24-Jan-16 7:34am    
Yeah, you're right. After some discussion, we decided to implement these UI parts respectively.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900