Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 54
Registered: ‎11-12-2008
My Device: Bold 9800 or Storm 3 whichever hits Verizon first.
My Carrier: Verizon

Individual classes or inner classes

Finally got my system all built squared away and some time to put to my own project.

 

Question regarding performance.

With BB devices would it be best to have individual class files or Big Classes that contain the coded inner classes?

 

Starting to UML out the files so I don't want to have to change it out later.

Thank you all for your support
black_berry
Developer
Posts: 80
Registered: ‎09-12-2009
My Device: Bold 9700
My Carrier: Vodafone UK

Re: Individual classes or inner classes

Best OO Practices would dictate to separate the classes as it makes maintenance A LOT easier.

 

As for performance, the only time you would want everything in one class file is maybe if you are writing a game.

 

Generally you won't need everything in one class and you won't lose performace.

 

(The only way you would lose performance in a proper OO enviroment is if it isn't coded correctly/tidily.)

Genius Development Scotland
Website: http://www.genius-dev.co.uk
Highlighted
New Developer
Posts: 54
Registered: ‎11-12-2008
My Device: Bold 9800 or Storm 3 whichever hits Verizon first.
My Carrier: Verizon

Re: Individual classes or inner classes

Thank you again, I thought this was the case but I was making the assumption of such and did not want to go off of assumptions.

Thank you all for your support
black_berry
Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: Individual classes or inner classes

I know the official RIM developer documentation gives some general best-practice information (including some counter-intuitive stuff like making String constants not final) for the BB platform.  There was also some mention of not going overboard with interfaces.

 

However, I do honestly wonder just how much of a difference all of this makes.  Even when I have bits of poorly written and totally inter-mangled code, it actually runs fairly well.  I also use plenty of inner classes and anonymous classes where it makes sense.  When apps are slow or large, I often suspect it is really just complete and utter abuse of graphics resource data.

 

Of course you should always strive for clean and optimal code.  That goes without saying.  But as long as you handle String and image data cleanly, I'm not sure how much a lot of these other nitpicks matter.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Individual classes or inner classes

Can you direct me to where in the documentation it says those things? I am developing a library which is a port of a C library. It uses many "replaceable" delegates and I supplemented that for interfaces so "not going overboard with interfaces" makes me nervous.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 292
Registered: ‎07-25-2008
My Device: Passport

Re: Individual classes or inner classes

RIM tries harder and harder to hide it amonst an overflow of other documents with each BB OS release.  It was seriously easy to find in the 4.2 days.  Not so much anymore.

 

Look on the main developer website for a section called "Development Guides".  Then dig around for something called "Fundamentals Guide - BlackBerry Java Development Environment".

 

Here's one:

http://docs.blackberry.com/en/developers/deliverables/3299/JDE_4.5_Fundamentals_Guide.pdf

(look on page 14)