Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Dimiensioned Measurement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric NY - 15 Jan 2008 12:48 GMT
There is now a robust java solution I've been reading about called jscience
(http://jscience.org). Is anyone aware of a similar effort in the .net
community? The library supports consistent handling of measurement and
conversion between quantities of the same dimension in just about every
international standard (SI)  and non-SI unit of measurement in such a way
that the compiler facilitates design time checking.

I'm in need of a few quantity types to deal with some common dimensions of
measurement in business, with Money being at the top of the list, and
Duration &
Length following. Barring an effort along the lines of jscience, any links
to code samples that do this would be much appreciated.

TIA
Eric
Jeroen Mostert - 16 Jan 2008 00:00 GMT
> There is now a robust java solution I've been reading about called jscience
> (http://jscience.org). Is anyone aware of a similar effort in the .net
[quoted text clipped - 8 lines]
> Length following. Barring an effort along the lines of jscience, any links
> to code samples that do this would be much appreciated.

Just write your application in Java!

Oh, wait, I just saw what group I'm in. My apologies. :-)

There's no particular reason you can't just ape what the Java folks are
doing. Java and C# are about on par now as far as support for genericity is
concerned (minor, niggling flamewars of epic proportion concerning the
implementation aside).

So when the Java library does

public interface Measurable<Q extends Quantity> extends
java.lang.Comparable<Measurable<Q>>

This maps one-to-one to the C# declaration

public interface IMeasurable<Q> : IComparable<IMeasurable<Q>> where Q :
IQuantity

And so on, and so forth. Of course, the interesting stuff (the
implementation behind all the type-enforced quantities) you don't get for
free, but the interfaces are certainly straightforward to st... borrow. The
library is distributed under the BSD license, so you don't even have to make
the stuff you st... borrow open. C# and Java are very close to each other in
terms of syntax, so you could just pick and choose the classes and methods
you need for your application and convert them to C#. This shouldn't take
too much effort.

Conceivably, you could easily have an NScience to go along with JScience,
much like with Log4J and Log4Net.

Signature

J.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.