Get flash to fully experience Pearltrees
Overview The enum in Java is more powerful than many other languages which can lead to surprising uses. In this article, I outline some the individual features of enum in Java, and put them together to form a state machine. Enum for Singleton and Utility class You can use an enum as a Singleton or Utility very simply. Enum to implement an interface You can also implement an interface in an enum. Each Enum Instance a different sub-class You can override the behaviour of an instance. This effectively give the instance a different sub-class of the enum with its own implementation.
We Recommend These Resources Today I'll talk about a famous problem : restarting a Java application. It is especially useful when changing the language of a GUI application, so that we need to restart it to reload the internationalized messages in the new language. Some look and feel also require to relaunch the application to be properly applied. A quick Google search give plenty answers using a simple : 1.
Updating Java EE in Production: A Report in Three Acts Including a Foreword and an Afterword | ZeroTurnaround.comForeword A few weeks ago I ran a survey asking a dozen or so questions about Java EE production update. I’d like to thank the 607 individuals who took some time from their busy life to help me out.
Edward Harned ( eh at coopsoft dot com ) Senior Developer, Cooperative Software Systems, Inc. February, 2010 [updated August, 2011] What is Fork-Join? Think of a fork in the road where each path eventually comes back together — joins. Fork-Join breaks an application into several parts for parallel processing and joins the results at the end. Figure 1: Fork-Join Structure
Does Java Have to be Extended? There is a lot of discussion in the Java community which language features should be added to the Java language and how they should be integrated. What seems to be missing is a discussion about the question if Java needs to be extended at all. Moreover, there should be a discussion about language features that have been added to Java and C# in the past and how they improved our productivity and the quality of our programs.
Last week I read an announcement about Chronon , a time travelling debugger. It sounds very appealling - if you're like me, you've often missed that spot where you should have had a breakpoint. Another common issue is reproducing bugs that happened out in the field.
Java application performance is an abstract word until you face its real implications. It may vary depending on your interpretation of the word 'performance'. This article is meant to give the developer a perspective of the various aspects of the JVM internals, the controls and switches that can be altered to optimal effects that suit your application. There is no single size that can fits all. You need to customize to suit your application. You may be facing one of the issues listed below:
We Recommend These Resources I have been doing web application framework development for a long time. In my first experience, we developed a “Web Application Framework“, to ease development so that even a business user could write an application. As the years passed, I never saw any business user writing applications because of the fact that this job belongs to programmers. Today some 4GL or DSL tools are still on the search of the same promise. Before writing our own framework, we had used WebObjects development tools, for Java web development.
When we say a program is "too slow," we are generally referring to one of two performance attributes -- latency or scalability. Latency describes how long it takes for a given task to complete, whereas scalability describes how a program's performance varies under increasing load or given increased computing resources. A high degree of contention is bad for both latency and scalability. Why contention is such a problem Contended synchronizations are slow because they involve multiple thread switches and system calls. When multiple threads contend for the same monitor, the JVM has to maintain a queue of threads waiting for that monitor (and this queue must be synchronized across processors), which means more time spent in the JVM or OS code and less time spent in your program code.
The Fallacies of Distributed Computing are a set of assumptions that L. Peter Deutsch and others at Sun Microsystems originally asserted programmers new to distributed applications invariably make. These assumptions ultimately prove false, resulting either in the failure of the system, a substantial reduction in system scope, or in large, unplanned expenses required to redesign the system to meet its original goals. [ citation needed ] [ edit ] The fallacies The fallacies are summarized below: [ 1 ]
The network bites. Never forget it. by Oct 6
J’ai été, il y a peu, confronté à un problème de performances que l’on peut qualifier d’ intéressant – dans la bouche d’un expert technique, ce mot a généralement tendance à provoquer une bouffée de panique chez les plus chevronnés des managers. Je vous explique. Le programme consiste à appliquer massivement un traitement identique à un volume important de données – bref, c’est un batch. Objectif opérationnel : assurer la capacité du système à traiter 50000 dossiers par heure. L’architecture d’exécution de ce batch est relativement classique : un contrôleur est chargé d’obtenir auprès d’un service métier une liste de dossiers à traiter, de segmenter cette liste en lots, puis de soumettre les lots à un pool de threads qui vont réaliser les traitements en parallèle – chaque lot est traité dans une transaction distincte. Le traitement unitaire d’un dossier est relativement long, de l’ordre de 2 secondes ; les lots sont donc petits – 4 dossiers – pour limiter la durée des transactions.
With Java NIO, you can theoretically manage 10,000 read, write and read/write connections with a total of one thread. Yes, but it's not clear to me how you can manage this under the Servlet API. With a custom non-servlet server, then sure, assuming the request processing for each channel is lightweight enough. Note that the Servlet API extensions that Jetty has implemented could be standardised so that standard Servlets could work nicely with an NIO server efficiently like Jetty already has done. See the title of this thread :)
We Recommend These Resources Oracle and the EU are escalating their legal battle over the Sun acquisition. The EU took the first step towards blocking the merger Monday with a formal Statement of Objections . Oracle immediately responded with a statement of its own, saying the EU has a "profound misunderstanding" about competition in the database market and "open source dynamics". Sources expected the objection to come soon after Oracle, led by CEO, Larry Ellison, refused to give up the MySQL database in the merger.
Joe Darcy has opened up a call for methods to add to the core JDK 7 lang/util package. The idea is to add methods that are "commonly-written utility methods". JDK 7 utility methods There is lots of prior art in the field of general utility method libraries for Java. Perhaps the best known is Apache Commons Lang .
The Myth of the Secure Network If there is one initiative that is routinely misinterpreted it is the Jericho Forum . The general believe is that the Jericho Forum Members want everyone to remove the firewalls from our networks.