Private Date

I was trying to write a Java class for an exercise in my class textbook. The job was to model a credit card. I figured an important characteristic of the credit card is the expiration date. At first I just created an instance variable of type String. Then I figured I would need a member isExpired(). That made me thing String was the wrong type for this variable.

Off I went to the Java API. The first Date class I found had something to do with SQL. That did not seem right. Then I found another Date class in java.util. However the docs for this class did not seem intuitive. I want to set a day, month, and year. There used to be a way to construct a Date object with such properties. But it had been deprecated to favor the number of milliseconds since some start date. How random.

Since I am a programmer, I decided to roll my own simple Date class. This was just for instructive purposes. Following good programming practices, I made the day/month/year private. I got down to writing my own comparison member. That's when I really got tested with my knowledge of what private means. I pass another Date object reference into my compareTo member. Can my member access the private instance variables of the Date passed in? It compiles fine. But it seems wrong. My gut tells me I should only be able to access private members of "this" object. Time to ask my professor about these details.

JavaFX is Here

Today I was reading the latest issue of Software Development Times magazine. There was an article on JavaFX in the first couple pages. Years ago I would have skipped over it. Now my eyes are trained to spot Java related technologies and dig in.

JavaFX is a platform for rich client Java applications. They can run as desktop or web applications. It is a late comer to the rich Internet application scene. AJAX, Adobe Flex, and Microsoft Silverlight are the competitors. And they have all beat Sun to the punch.

Strangely enough, Sun Microsystems considers JavaFX a replacement for PHP. Its biggest benefit is the ability to use Java classes. It can run in the Java Virtual Machine. Some call the syntax similar to that of JSON.

You can use JavaFX for things such as animation and special effects. I would have thought you could use Swing for that. In fact, many of the user interface controls in JavaFX come from Swing. I am busy learning the basics of Java right now. However JavaFX might be worthwhile when I get my legs in Java basics.

Welcome to Java

I have spent the majority of my career on a single project. To stay aboard, I have moved from one company to another. This is a big government contract. After nearly 10 years, the daily challenges are still exciting.

When I first took the job, it was just what I was looking for. There were some Visual C++/MFC applications. The back end was the Oracle database that I wanted to learn. Things seemed great.

Somewhere in the last few years, the customer wanted to go to the web. This sparked all kinds of work to produce an enterprise edition rewrite of the system. That proved harder than it sounds.

Part of the rewrite was to migrate the client server applications to some Java on the back end. I was clueless on how to help this effort. Luckily it was a drastic failure and the upgrade got shelved. However it may come back from the grave. I need to be ready next time. It is now time to learn Java.