• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

design patterns and unit testing for j2me

 
Meg Smitley
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I am working on a mobile phone application for multiple devices connected through Bluetooth. I am new to J2ME development, but I have a background in J2EE and I was wondering if anyone had advice re. design patterns for J2ME applications. I realise that the KVM places constraints on code size, and I wondered what design patterns helped to separate logic but minimise code size.

I am also interested in TDD. I used JUnit for J2EE dev, and I've got J2MEUnit, but I'm not clear the best uses of J2MEUnit. Hmmm, I realise that I'm being vague here, but I am really confused about the best uses of J2MEUnit and Google hasn't helped me get any insight. Can anyone share examples of how they used J2MEUnit?
Best,
Meg
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the one big thing about J2ME is that you don't want to make too many classes because of memory of loading those classes.

You will find that you will have big classes with lots of code. That is normal.

Also, it is prevailing wisdom to not create packages.

You can split your MIDlet class into a MIDlet class and a Controller, but that is about as far as I would take it.

Haven't used Unit Testing myself with MIDlets as the code hasn't been that much that using an Emulator testing can't work out.

Good Luck

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I almost forgot. Also, look into J2ME Polish, if you are going to code for different devices. Especially with BlueTooth, since many devices don't implement JSR 82 Bluetooth API as well as you would like.

For instance, my Siemens S66 doesn't even run the Bluetooth sample in the Wireless Toolkit that follows the JSR API precisely. It does Device searching fine, but Services searching does not work.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic