 Your new post is loading...
 Your new post is loading...
|
Scooped by
Mickael Ruau
March 31, 2016 8:13 AM
|
Clean Coding Practices for Java Developers Clean Coding Practices for Java Developers John Ferguson Smart …
|
Scooped by
Mickael Ruau
November 19, 2015 5:35 AM
|
It is true that Java cannot take credit in being among the safest options to use online, due to the vulnerabilities that emerge within its applications on
|
Scooped by
Mickael Ruau
June 26, 2015 4:24 AM
|
Ces dernières années, on parle beaucoup du Test Driven Development, aussi connu sous l’acronyme TDD. Ce dernier s’inscrit en fait dans une démarche d’amélioration de la qualité des applications. En effet, les tests doivent normalement être écrits avant le code et doivent commencer par échouer. Sinon, le seul intérêt des tests unitaires sera de garantir une non régression par rapport au code actuel. Autre avantage des tests unitaires : pour que votre code soit testable il faut qu’il soit un minimum bien construit, sinon l’écriture des tests devient très complexe. James Carr a d’ailleurs publié un catalogue d’anti-patterns sur le sujet.
|
Scooped by
Mickael Ruau
May 27, 2015 12:35 AM
|
Unix pioneer Ken Thompson once said, “one of my most productive days was throwing away 1000 lines of code.” In this article Cas Saternos highlights practices now possible for writing concise Java code, with a special focus on the new functionality available in JDK 8. Shorter, more elegant code is possible due to the inclusion of Lambda Expressions in the language.
|
Scooped by
Mickael Ruau
May 12, 2015 10:11 AM
|
I hear views from beginners to distinguished developers claiming you shouldn't/I can't imagine why you would/you should be sacked if you use X, you should only use Y. I find such statements are rarely 100% accurate. Often there is either edge cases, and sometimes very common cases where such statement are misleading or simply incorrect.I would treat any such broad comments with scepticism, and often they find they have to qualify what was said once they see that others don't have the same view.
|
Scooped by
Mickael Ruau
April 17, 2015 3:49 AM
|
Passing behaviors, not only values
What we have seen in the former example is the main and possibly the only reason why lambda expressions are so useful. Passing a lambda expression to another function allow us to pass not only values but also behaviors and this enable to dramatically raise the level of our abstraction and then project more generic, flexible and reusable API.
|
Scooped by
Mickael Ruau
April 17, 2015 2:50 AM
|
Efficiency through laziness
Another advantage of internal iteration of collections and more in general of functional programming is the lazy evaluation that it allows.
|
Scooped by
Mickael Ruau
April 11, 2015 12:41 PM
|
A bunch of wizards are available for easier creation of:
CDI Web project
Bean
Interceptor
Decorator
Qualifier Annotation
Scope Annotation
Stereoptype Annotation
Interceptor Binding Annotation
Annotation Literal
and more.
|
Scooped by
Mickael Ruau
April 11, 2015 11:37 AM
|
In Java 7, resource cleanup was automated by means of the try-with-resources block. In practice, this new syntax allows you to declare resources that are part of the try block. You define the resources ahead of time and the runtime automatically closes those resources (if they are not already closed) after the execution of the try block.
A resource can be any object that implements the interface java.lang.AutoCloseable.
Although the try-with-resources block can have a finally or catch block, it is not mandatory.
|
Scooped by
Mickael Ruau
April 11, 2015 5:45 AM
|
Cet article est une introduction à l'audit de performance d'une application en Java/Java EE.
|
Scooped by
Mickael Ruau
April 11, 2015 5:41 AM
|
Cet article a pour objectif de présenter les Design Patterns du "Gang of Four" avec des exemples concis appliqués à Java. Chaque Design Pattern est présenté avec son diagramme de classes, ses objectifs, les motivations pour l'utiliser, les responsabilités des classes le constituant, puis une implémentation simple.
|
Scooped by
Mickael Ruau
March 24, 2015 10:30 AM
|
Project Lombok is a very interesting API and in this tutorial we will se how to use its build in annotations to generate methods such as getters/setters etc in a simple pojo class.
|
Scooped by
Mickael Ruau
March 24, 2015 10:24 AM
|
Table of Contents
1. Java Preferences API 2. Exercise: Using the API 2.1. Create program 2.2. Validate 3. About this website 3.1. Donate to support free tutorials 3.2. Questions and discussion 3.3. License for this tutorial and its code 4. Links and Literature 4.1. vogella Resources
|
|
Scooped by
Mickael Ruau
February 12, 2016 3:46 AM
|
Apprendre à utiliser COJAC, un Sniffeur de problèmes numériques et usine de nombres enrichis pour Java
|
Scooped by
Mickael Ruau
July 23, 2015 3:44 AM
|
Je suis régulièrement amené à recevoir des candidats de tous niveaux afin de procéder à une évaluation technique et une de mes questions fétiches concerne `equals` et `hashCode`. Tout développeur se doit évidemment d'être parfaitement affûté sur ce sujet on ne peut plus basique. Pourtant, la réalité montre que la majorité des réponses sont au mieux incomplètes et bien souvent totalement fausses.
|
Scooped by
Mickael Ruau
June 1, 2015 2:41 AM
|
With architectures becoming more distributed and code more asynchronous, pinpointing and resolving errors in production is harder than ever. In this article we investigate five advanced techniques that can help you get to the root cause of painful bugs in production more quickly, without adding material overhead.
|
Scooped by
Mickael Ruau
May 27, 2015 12:31 AM
|
Oracle is targeting a Java 9 GA release date of September 2016. The schedule follows Oracle’s plans to release a new major version every two years, although contrasting to previous releases the currently proposed deadline might be at risk for some slippage.
|
Scooped by
Mickael Ruau
May 12, 2015 10:09 AM
|
J’ai assisté cette année à mon premier Devoxx et je souhaitais faire un retour sur ma conférence préférée de la journée de vendredi, celle sur Java 8 de Trisha Gee. Je ne suis pas biaisée, mais ce serait difficile de ne pas avoir appréciée une conférence par... #devoxx #java8 #javafx
|
Scooped by
Mickael Ruau
April 17, 2015 3:48 AM
|
Since the old days of Swing, we always had written anonymous classes if we wanted to pass some functionality to any method. For example the old event listener code used to look like:
someObject.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { //Event listener implementation goes here... } }); Here we wanted to add some custom code to Mouse listener. We defined an anonymous inner class MouseAdapter and created its object. This way we passed some functionality to addMouseListener method.
In short, it is not easy to pass plain methods / functionalities in Java that can be passed as arguments. Due to this limitation Java 8 adds a brand new language level feature called Lambda Expressions.
|
Scooped by
Mickael Ruau
April 16, 2015 3:45 AM
|
Java 8 has a new feature called Default Methods. It is now possible to add method bodies into interfaces!
|
Scooped by
Mickael Ruau
April 11, 2015 12:19 PM
|
Not so many developers are clearly make a distinction between design and architecture, and the experience of the interviews shows that the basic paradigm of OO…
|
Scooped by
Mickael Ruau
April 11, 2015 11:32 AM
|
These issues are discussed in context on this page and are also listed in this section of Hibernate Guidelines.
No communication with the database should occur outside of a database transaction. Doing so will probably result in synchronization issues. Transactions should also not encompass user think time. Details are of how it's done is discussed in the Defining Transaction Bounds section of this page. createQuery() can easily be passed a tainted SQL or HQL string, dialect is irrelevant. The proper way to construct a sql string hibernate style is to use Query and SQLQuery's setParameter(), setString(), setXXX() methods for named parameter and placeholder binding. Just like prepared statements. Details are discussed in the Creating Queries section of this page. Persisting tainted objects is stored xss. Since stored XSS is generally hard to find with static tools, it is best to sanitize all data going in rather than waiting for it to show up on a jsp somewhere. Details of these functions are discussed in the Persisting Tainted Data section of this page. An application should rollback and discard Session instance on error. So if the Session throws an exception, the catch block should have rollback() and finally should call Session.close(). This applies to any SQLException. Pretty cut and dry, see Example1 above. You may not mix and match JDBC-style parameters ("?") and named parameters (:namedparam) in the same query. Person aPerson = (Person) session .createQuery("select :somenamedparameter from ? where x = :someothernamedparameter"); Transaction.setTimeout(int) should be called to ensure that misbehaving transactions do not tie up resources in definitely. Session sess = factory.openSession(); try { //set transaction timeout to 3 seconds sess.getTransaction().setTimeout(3); sess.getTransaction().begin(); // do some work ...
|
Scooped by
Mickael Ruau
April 11, 2015 5:42 AM
|
Cet article présente les tests unitaires JUnit4 avec Spring.
Les cas de tests présentés sont sur des classes sans accès à une base de données et sur des classes nécessitant un accès à une base de données.
|
Scooped by
Mickael Ruau
April 11, 2015 5:38 AM
|
Ce tutoriel a pour but de présenter la sérialisation XML en Java. Il commence par les bases et continue sur les fonctionnalités plus complexes qui vous permettront une maîtrise totale de ce mécanisme.
|
Scooped by
Mickael Ruau
March 24, 2015 10:24 AM
|
Table of Contents
1. Overview 1.1. Logging 1.2. Logging in Java 1.3. Create a logger 1.4. Level 1.5. Handler 1.6. Formatter 1.7. Log Manager 1.8. Best Practices 2. Example 2.1. Create the logger 2.2. Use the logger 3. About this website 3.1. Donate to support free tutorials 3.2. Questions and discussion 3.3. License for this tutorial and its code 4. Links and Literature
|