This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP and have Lucian Maly on-line!
See this thread for details.
Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

looking for JAirDensity contributors

 
Author
Posts: 587
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAirDensity is a Java utility class that determines air density from temperature, air pressure and dewpoint.  The source code for JAirDensity is available on GitHub; https://github.com/robertjliguori/JAirDensity

It would be nice to have more developers maturing/refining/improving the utility class.  

Note: The utility is complete for dry air density and humid air density, but addition methods, algorithms, and tests can be added... such things will be identified in the issues.

Thanks!
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I quickly looked at the code and there is one thing I noticed, lines 72 and 127 in AirDensityCalculator.java, in the method getDryAirDensity:

That is a really bad idea. It means the whole program stops immediately if that line is reached. Much better would be to throw an exception instead, for example:

Also, the design could be better. The code is getting messy with all those switch statements. You could use a design pattern such as the strategy pattern for the different calculations that are necessary for the different types of units.
 
Let nothing stop you! Not even this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic