开发者

Enterprise mobile (WinCE) development best practices

I am getting more involved with thick client mobile development on the Windows CE5+ platform and was wondering what the best practice is for handling applications with 10+ screens.

From initial investigate there are two option

1 - Instantiating a new instance for a form every time it is required. This obviously is process intensive and lags the UI

2 - Instantiating all form on the project load or as the form i开发者_JAVA技巧s loaded holding it in memory. Less processor intensive but consumes memory, reduces UI lag.

If using option two what is the best method to marshal the forms so the correct form appears top most.

Please let me know your thoughts


I tend you use a hybrid of your options. I lazy load Forms on-demand to keep start-up reasonable, but cache Forms that are used often. I also tend to not use actual "Forms" much. I have a main Form for the app, then Forms for dialogs/popups but most app implementation of Views I do in UserControls (well SmartParts which derive from UserControls. These are then managed in an IoC/DI framework (specifically OpenNETCF IoC) that does most of the creation work for me anyway.

As for what is topmost, that really depends on your mechanism. In my case the framework makes sure that what is supposed to be on top is (whether through a StackWorkspace, TabWorkspace or whatever), but if you're doing Forms, simply calling Show on the form you're navigating to will bring it to the fore. If you're converned more about what to show as a user "backs up", then you need to store that info - a simple framework (like this one, which I also rewrote for IoC) tends to work well.


You should be very careful with the loading/unloading of the images or resources. A factory of such is definitely a good idea.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜