Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Object Reuse J2me

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

got 2 questions on J2me and reusing of objects.

1. is it a good idea to reuse the objects of classes under the javax.microedition.lcdui package i mean most of the UI related objects.

2.the second is about reusing a thread for network hits.


Thanks
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Object reuse is normally a good practice. However, consider how much memory is available to the application and how frequently an object can/will be reused.

Some devices have issues with creating many UI components; i.e. http://wiki.forum.nokia.com/index.php/KIJ000345_-_Creating_too_many_Canvas_instances_throws_an_outOfMemoryException

Think about the architecture of your application; identify the candidates for reuse.

2) I would suggest using a non-busy wait pattern for networking; queue the network operations and use one or more worker threads to execute the operations.
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic