• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

design patterns and unit testing for j2me

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic