Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one implement UI independent applications?

What are the fundamental techniques to make most part of my C# source code UI independent?

For example, I would like to write my source code for Winforms desktop application which I shall be able to plug into asp.net web application or a WPF application with very minor changes. I.e. I shall be able to use the same source code irrespective of UI technology to make it future-proof.

I know CSLA framework can do that.

But if I don't use CSLA (it takes some time to learn a new framework and at present I don't have that much time to spend on it), what points should be taken care of to achieve this kind of ability in my C# code?

Can you give me an example? I already use Business Objects and layering technique in my applications. But even so I have seen that it needs a lot of coding to plug my code to new UI technologies.

Please do not provide me with any superficial answer.

like image 526
user366312 Avatar asked Dec 01 '22 11:12

user366312


1 Answers

The best way to do UI independent coding is to seperate the logic from the presentation. Take a look at the MVC pattern.

This is more of an discipline issue with your design rather than a framework issue. A framework can't not force you to design properly. It can make things easier for you if you design the app properly, however there are always ways around the enforcement of it.

like image 172
monksy Avatar answered Dec 03 '22 00:12

monksy