Reverse Psychology
In Java






Geneva Jug 4th Anniversary
January 28th 2014

Who the hell is Nicolas PERU

Geek
Father of 1.6
Java Developer
SonarSource
SoftShake Organiser
Jug fan
Human Talk maniac
Follow me ! @benzonico

Conventions

Habits

Practices...

 In (Java) Programming

Let's write :  


public class StandardClass extends UDuSlip{
	
  private String parameter;

  public StandardClass(String parameter){
    this.parameter = parameter;
  }

  public static final int THE_CONSTANT = 42;}
 

Field Layout in Classes

(Merci wikipedia)
 


Naming Methods



Broken Beans

Encapsulation


Java Beans


 


Getters/Setters with behaviour


The Vicious Circle 

Anemic Domain Model


GroupThink


Status Quo Bias

 

 

Dependency Injection

public class PizzaService{  @Autowired
  private AnchovisDao anchovisDao;  ...
  @Autowired
  private CaperDao caperDao;
...}


public class PizzaService{  private AnchovisDao anchovisDao;  ...
private CaperDao caperDao;
@Autowired public MyClass(AnchovisDao anchovisDao , ...  CaperDao caperDao){ this.anchovisDao = anchovisDao; ...
this.caperDao = caperDao;
}}


Framing Effect

Cygnes reflétant des éléphants Dali 1937

Conclusion
Q&A

and other boring stuff... 




And remember to follow: 
 @benzonico
 @SoftShakeEvent
 @SonarSource 

Reverse PsychologieIn Java

By Nicolas PERU

Reverse PsychologieIn Java

  • 1,277