• 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
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Javadoc & FlightController

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody,
I have 2 questions:
JAVADOC:
There are 2 javadoc tags for exceptions (@exception, @throws) which one should we use (in Data @exception is used - but jbuilder automatically creates a @throws tag)
if more than one exception is raised , the excptions should appear in alphabetical order - am i right? is this also necessary in the method declaration?
FLIGHTCONTROLLER:
i am using a class called FlightController, which has methods like bookSeats(String flightNr, int desiredSeats), findFlights(String criteria), getFieldValues(String fieldName)- used for dropDowns and it creates also the connection to the Database, using a class called DataConnector (getRemote() getLocal())..., so basically this is the Application Facade. The FlightController is created either with one param specifying the connection type or specifying connectionType and host/port for remote connection. My Question: Should create a static method getFlightController(String[] params) to create a valid FlightController?
hope someone can help me.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@throws and @exception are synonymous with each other, @throws was just added after @exception. Personally I use @throws.
Yes, you should list multiple exceptions in alphabetical order.
As far as a static factory method for getting an instance of your FlightControler instead of a constructor, there are advantages and disadvantages to using it. You should consider the benefits of the static method and base your usage of it on the compelling need for one of these.
Some of the advantages are:
1) Allows you to control the number of instances.
2) Effectively allows you to give meaningful names to your methods that construct instances of your class. This comes in handy when you have multiple constructors and would like to describe what they do in some way other than the parameter names.
3) Allows you to return subclasses.
-BJ
[ March 17, 2003: Message edited by: BJ Grau ]
 
Mario Zott
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you, for answering all my questions - I will use the @throws tag, and let FlightController act as a Factory....
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic