This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why "getEJBHome()" but not "getEjbHome()"!?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a method in javax.ejb.EJBObject interface: "getEJBHome()". But if we follow the usual Java naming conventions this method should be named as "getEjbHome()"! Please explain why it has gone as "getEJBHome()". Thank you.
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My best guess wud be that its just the JAVA team's decision. Kathy might get some insight into this coz she knows the team.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB is abbreviation and not just a regular word. (E)nterprise (J)ava (B)ean. I believe this is the reason you see EJB instead of Ejb.
 
Nesan Krish
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, then why ejbCreate() method comes as "ejbCreate()" and not as "EJBCreate()"!!?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the method ejbCreate() is not written as EJBCreate() because the first letter of all method calls should be a lowercase letter. This would produce eJBCreate() which looks odd so all of the letters from EJB are turned into lowercase to give ejbCreate().
The method used to join words together like this is referred to sometimes as camelcase, see below link for details. CamelCase
 
Harimohan Bawa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Nesan Krish:
But, then why ejbCreate() method comes as "ejbCreate()" and not as "EJBCreate()"!!?


I believe it is not about looking odd. As I observed in Java Programs and used personally for method names, abbreviations either are all up or all down depending upon where they fit in method names.
In English grammar they may be all UP unless noted elsewhere.
ex: NATO is never used as a Nato , nATO.
WHO (World Health Organization) is not used as Who.

getEJBHome()
ejbCreate()
I hope it answers your question.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Ambler advocates for something different:
From IBM developerWorks: Java naming conventions:


Capitalize the first letter of standard acronyms
Names will often contain standard abbreviations, such as SQL for Standard Query Language. Names such as sqlDatabase for an attribute or SqlDatabase for a class are easier to read than sQLDatabase and SQLDatabase.

 
Get me the mayor's office! I need to tell her about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic