开发者

writing an abstract code for windows and the web?

I hope this isn't a stupid question:

I wonder if there’s a way to build a web client and a windows desktop client (that looks the same and offer the same features) with the same code (not just same language), at least till a certain point开发者_如何学运维 - in other words, having an abstract code that will fit the web server and windows?

Thanks!


You should take a look at Adobe's FLEX, you can have same classes/layout for both web apps (run under Flash) and desktop app (run under AIR). The only difference will be in the main file, you will have one for each flash and air app. (The rest of code will can be compiled into one SWF, also have in mind that you should use same functionalities for both web and desktop )


I believe Java can do what you want, with minor modifications to have it run as a full-blown desktop application vs a Java applet.

One thing you'll need to do, is ensure that for the app, your main function is very small (ie, only call the main JFrame or whatever), and replicate that simple call in the applet code.

For the differences between the two, see for example, here and here. You'll need exactly one tiny source file that's different for the applet vs application.


Real Studio will also let you do this to some extent. Newer versions can create web applications and desktop applications. Non-UI code can be shared with web and desktop apps. The UI code will have to be different, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜