Peace For All

June 3, 2007

For once, I want good integer subtyping!

Filed under: Java, Programming — Devlin Bentley @ 6:00 pm

I am using an integer ID in parts of my program, I want to ensure that the ID is an actual ID that I have returned.  In a strongly typed language that also has a well fleshed out subtyping system, this would be trivial!

subtype AlbumID is long

The benefit of course would be that I could keep track of my AlbumID types and not have to worry about anything else!

Now the proper Java way is to make a new class called AlbumID that has a single long field and…  bleck!  I just want compile time checking darnit, I don’t need anything instantiated.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: