Category Archives: Java

Encapsulation, Inheritance, Abstraction, and Polymorphism … oh my

Encapsulation

I like to think of encapsulation as group like attributes together in a way that makes sense. A Class is, in a sense, a template to follow when instantiating (creating) an Object. A Class defines the characteristics (attributes) and behaviors (methods) of the group of characteristics. For example, if we are designing an application that tracks personal contacts, then a Person class would look like:
Continue reading Encapsulation, Inheritance, Abstraction, and Polymorphism … oh my

Null Pointer Exceptions in Java – One Person’s View

Java is, in my opinion, an excellent programming language for developing applications. However, when requirements are unstructured or vague, the advantages of Java become difficult to implement. Variables (or class members) that are expected to have values are sometimes found to be null (or absent of data). When a variable is found to be absent of data, a NullPointerException (NPE) is is thrown at runtime when a operation is performed to manipulate the data. The NPE is an unchecked exception, which means that the exception is only realized at runtime, not compile-time. A developer will not know that an operation will fail until the application actually executes and the variable is found to be null.
Continue reading Null Pointer Exceptions in Java – One Person’s View

Domain Specific Language (or asking for directions in 10 different languages)

Imagine traveling to a foreign country and needing directions to your hotel. You are not fluent in the language of the country you are visiting, so you install an application on your mobile device to aid in translating your language into the country’s native language. Now you have a remedial way to take your native language and translate what you say into something that could be understood by the residents of the foreign country. This is an example of what domain specific languages are in the world of computing.
Continue reading Domain Specific Language (or asking for directions in 10 different languages)

Programming – Tips for Troubleshooting an Application Issue (or “It’s broke – fix it NOW!”)

I re-learned some important troubleshooting techniques recently that I’d like to share with you. They are rather simple and could save hours of time trying to fix something that’s broken.

Continue reading Programming – Tips for Troubleshooting an Application Issue (or “It’s broke – fix it NOW!”)

Java – Status Reporter released

I attempted my first release of an open source project today. The application is called Status Reporter and I have some summary information about the application here.

I wrote it because I wanted to keep track of my time at work. I used my home computer and my time to write the application. It took a bit, and I was a bit uncomfortable at first releasing the code for others to see. I’m my own worst critic. Hopefully, others find it useful and are able to track their time in a slightly more efficient manner.

Enjoy!

Java – why use interfaces?

An interface is a way to describe how to interact with a class that implements defined methods. An interface only defines how to interact with an interface or class that implements the interface, not the actual implementation. In other words, an interface exposes what behaviors will be available, not how the behavior is carried out. In the real world, all cars have horns, but each car’s horn may have a distinct volume, pitch, sound, and duration. The interface for each car may be the same (pressing the center of the steering wheel), but the sound produced by each car (the implementation) is different. This allows any driver to know how to use any car horn, not how the sound is produced by the internals of the car.

Continue reading Java – why use interfaces?