Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The next version of the application will be a .NET based application (both desktop and web). The requirement is that both applications have to look and work exactly the same way. I was thinking that maybe there was a way to create a web control or something and use it in both applications.

Is this possible?

For example can I create a user control for the web and use it for the desktop (without using a web browser control)? If the above isn't possible, what are my alternatives?

Please let me know.

share|improve this question

4 Answers 4

up vote 1 down vote accepted

Since you're using .NET anyway, you could use Silverlight which provides a fairly rich web experience and can then be run directly on the desktop (essentially bringing the web to the desktop rather than trying to take a desktop app to the web).

There's much confusion over Microsoft's long-term commitment to Silverlight at the moment, though, so it may not be the right time to be making long-term technology commitments.

Alternatively, you could go for a similar approach with HTML5 which MAY prove to have a longer life-span - but the tool/browser support isn't as well established (and it's not .NET)

Actually - that's a question: what level of cross-browser support is required for the web app. Is a client-side browser technology viable, or do you need to do everything server side?

share|improve this answer
    
It is server side code. I forgot about Silver Light. I'll be honest that may be the best way to go even with the Microsoft issue. As it could be a good bridge until HTML5 gets more mature. –  webdad3 Aug 7 '11 at 15:08

I had to deal with a similar case.

You have to check which common controls from webforms & winforms can look similar. You may wanto to check if employeer allows you to buy third-party controls libraries or open source libraries, in case the integrated controls aren't enough.

share|improve this answer
    
Basically what I'm interpreting is that there is no way to write 1 piece of code for both environments. All I can do at best is make them look similar in nature. –  webdad3 Aug 6 '11 at 17:17
    
You may want to separate logic code from interface code, use methodologies like 3-layer, entity framework, M.V.P., M.V.C., and make interface to be different, but, logic & data access the same ;-) –  umlcat Aug 6 '11 at 18:15

The web is a different canvas than the desktop. Applications are not meant to look the same on each.

Concentrate your efforts more on code reusability through code libraries and having both applications achieve the same functionality.

If you try to make the UIs the same, you're going to have a desktop application trying to look like a web application, and a web application trying to look like a desktop application. Two thumbs down on that.

share|improve this answer
    
I agree with your statement. I will bring this up to the owner, however, it is his requirement. Are you saying that what I'm asking CAN NOT be done? –  webdad3 Aug 6 '11 at 16:39

Note: I won't argue with your idea to have two identical UI for the desktop and web app. This is a terrible idea, and I highly suggest you to recondider it. Please create an optimized UI for each device.

The best way to have identical UI is to create your own controls or use an existing suite. There are many of them available. I personnaly use DevExpress.

They do a pretty good job at making their controls look similar on both web & winforms.

Since they use the same core components, it's pretty easy to reuse almost all your business logic.

share|improve this answer
    
Please note... Not my idea but it is the requirement... –  webdad3 Aug 6 '11 at 16:29
    
I guess also... When you say create your own controls. Can I create 1 user control and use it in both projects? –  webdad3 Aug 6 '11 at 16:30
    
@webdad3: no, just like you should do for your different UI, you will have to create different rendering for both. But you can share some core things. The best example is a charting control. In both case it's an image that is generated, but rendered differently on both web & winforms –  user2567 Aug 6 '11 at 16:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.