Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Package Names and Web Apps

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that HFSJ names packages:

com.example.model
com.example.web

Is this based on a website name paradigm. So for instance, if my website were called xyz.com, my packages would be called com.xyz.model, com.xyz.web ?

Do the packages in a webapp always begin with com, org, it, etc. . . ?

Just looking for guidelines to use for package names when developing my own applications.

Thanks
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look herefor Java coding conventions.

To answer your question while package names do not have to begin with com, org etc. they typically do. Convention many companies follow is
com.companyname.businessunitname.projectname.modulename.whatever
You may add or take out stuff from above as needed. If I were writing a test programs, I would simplay create a package named 'test' (without quotes) and it would be perfactly valid.

Download any jar file such as junit, struts, commons logging, log4j and open it with winzip you will see package structure under path column. That should give you a pretty good idea.

If you are writing your own personal application, feel free to give whatever package name you want (make them all lower case by convention though). If I were you, I would put my name in it so if some one decides to download or distribute my code, my name also goes out there

Edit: Forgot to add that if I were HFSJ, I would put com.oreilly.hfsj.chapterx.example or something similar
[ August 25, 2005: Message edited by: Chintan Rajyaguru ]
 
Jack Gold
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
Clowns were never meant to be THAT big! We must destroy it with this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic