Re: Java ME + SE Application Development
[email protected] Thu, 10 Jul 2008 07:37:35 PDT
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <4560735.140761215700699364.JavaMail.tomcat@sdcst12.sjc.collab.net> |
I have seen demos of Netbeans supporting a feature much like #IFDEF.... but didn't java get started as a way to avoid this type of thing?! Of course and there is very simple and ObjectOriented ways to do this. <br><br> I wrote a project called Microbus out in the dev.java.net repository that runs on both ME and SE. It can determines the platform it is on or can be told by the constructor, and then loads the implementation classes accordingly. In fact it optimizes for SE by using an ArrayList while on ME it has to use Vector. All of that without having to code any platform specific logic or special preprocessors. <br><br> In addition you can use ant to build and load only those classes specific to the platforms needs, thus reducing the code size. <br><br> As for Bluetooth another java.net project Marge has your back. It is the JSR82 implementation for JavaSE. Bruno Ghisi wrote about it back in this blog <a href="http://weblogs.java.net/blog/brunogh/archive/2007/09/jsr_82_is_not_o_1.html">entry</a>(1). <br><br> When developing GUI for ME if you use the CustomItem you end up writing a class that looks very much like a Java Component. The difference here is that in one case you extend CustomItem, and in the other you extend JComponent, or Component. To address this you can have wrapper classes which contain a painter class, and are in the same package as their other platform (SE/ME) counterpart. The painter class is common to for both ME and SE, while the wrapper is platform specific, but turns out to be nothing more than an adapter pattern. <br><br> Friends don't let friends use #IFDEF. Trust me to debug code like that is a nightmare without stepping through each line to determine what path is really being taken. <br><br> Best wishes,<br> -Shawn (1)-http://weblogs.java.net/blog/brunogh/archive/2007/09/jsr_82_is_not_o_1.html [Message sent by forum member 'sfitzjava' (sfitzjava)] http://forums.java.net/jive/thread.jspa?messageID=285679 =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".