Welcome!

From the Trenches of the Enterprise Software

Yakov Fain

Subscribe to Yakov Fain: eMailAlertsEmail Alerts
Get Yakov Fain via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Top Stories by Yakov Fain

While working on the second edition for my Java 24-hour Trainer book I’m re-writing some of the code samples to use lambda expressions. Today I was re-writing an example for wait/notify for the chapter on multi-threading. Beside illustrating the wait/notify, I used a closure in this example. Since Java closures are not well presented in the blogosphere, I decided to write a quick blog on the subject. My goal was to write a program that starts a thread and waits for the notification from that thread until its execution is completed. When the main thread receives the notification from the second thread it continues processing. In the traditional object oriented programming you’d create a class that implements Runnable with a constructor receiving an object to send notification to, for example: class MarketNews implements Runnable throws InterruptedException{ Object ... (more)

Yakov Fain's (@yfain) Blood Pressure At @ThingsExpo

Blood Pressure While Presenting at Conferences In June I was presenting at the Internet of @ThingsExpo at the Javits Center in New York City. During my talk I was demonstrating how to integrate consumer devices into a business workflow. In particular, I was doing live measuring of my own blood pressure to show how to integrate consumer devices into a business workflow. Internet of Things, you know. The results were automatically appearing in my customized Web application. When the results appeared on my mobile device I was quite surprised to see that my pressure was 200/120. This... (more)

What’s the Difference Between Abstract Classes and Interfaces?

Probably the most popular question during Java technical interviews is “What’s the difference between abstract classes and interfaces”.  In my own three year old book I’ve offered the following answer: “An abstract class may contain code in method bodies, which is not allowed in an interface.With abstract classes you have to inherit your class from the abstract one because Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.” But starting from Java 8 this answer is wrong. This is how I’d answered it now: “Both abstract... (more)

Using URL Shorteners in Technical Documents

I spend a large portion of my time preparing courseware materials, writing books and technical documentation. These documents include hyperlinks, and some of them can be a 100+ character long. Do you include the long URLs in your docs? The immediate answer is to use one of the services like bit.ly, tinyurl.com, is.gd and the like.Beside shortening URLs the may offer other services like click-stats or real-time analytic data. But all of these services are backed by rather small companies. What if your preferred URL shortener is out of business, but thousands of your books are bei... (more)

JavaFX Event Handling and Property Binding

Some time ago I blogged that Java Swing should be deprecated and replaced with JavaFX. In this blog I’ll show a piece of JavaFX namely event handlers and binding. I’ve created a simple Sign In window with a GridPane layout (it’s JavaFX equivalent of Swing’s GridBagLayout). I’m not going to spend much time on the GridPane itself, but will show you a basic event handling and a binding. In JavaFX an event object is represented by the instance of the class javafx.event.Event. There are different ways of handling events. Depending on how you structured your application you can handle... (more)