Re: [OJB-developers] various questions
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-04-29 05:48:49
|
hi, 4.) i prefer the following style for braces if (true) { doThis(); } i think it's more readable than if (true) { doThis(); } another issue is member access. instance variable should be accessed using getters and setters . just my 0.02 CHF jakob ----- Original Message ----- From: "Chris Greenlee" <CGr...@de...> To: <tho...@ho...> Cc: <CGr...@de...>; <Joa...@tp...>; <obj...@li...> Sent: Sunday, April 28, 2002 7:12 PM Subject: Re: [OJB-developers] various questions > > > > > That's a nice idea. I think the simplest way to start such a discussion > > to start with someones first draft proposal. Others might comment on > > this draft. > > > > Any volunteers? > > > Sure. :) I'll just throw out the ones I'm most familiar with to get things > started. > > 1. Non-static member variables. > > a. References prefixed with "this.". > b. First letter lowercase, beginnings of subsequent words capitalized. > > private int Anint = 0; > > public void increment() { > Anint++; > } > > would become > > private int anInt = 0; > > public void increment() { > this.anInt++; > } > 2. Static member variables. > > a. All uppercase. > b. Underscores ("_") used to separate words. > > So > > private static int aStaticInt = 50; > > would become > > private static int A_STATIC_INT = 50; > > 3. Method names (static and non-static). > > a. First letter lowercase, beginnings of subsequent words capitalized. > > So > > public static int GetInt() { > return 5; > } > > would become > > public static int getInt() { > return 5; > } > > 4. Braces around blocks of code. > > a. Opening brace on the end of the line starting the block. > b. Closing braces aligned with the beginning of the line starting the > block. > > So > > if (true) > { > doThis(); > } > > would become > > if (true) { > doThis(); > } > > 5. Method / member organization. > > a. Member variables declared before methods. > b. Static members declared before non-static members. > c. Static method declared before non-static methods. > d. Private members declared before protected members. > e. Protected members declared before protected members. > f. Public members declared after all others. > g. Same precedence for methods. > > 6. Test class naming. > > a. All JUnit test classes should be named "xxxTest". > > So > > public class TestOfClassA extends TestCase { > } > > would become > > public class ClassATest extends TestCase { > } > > And that's what I can think of off the top of my head. Have at it. :) > > Cheers, > > Chris > > > > > > > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > |