Commits

Anonymous committed f438fca

mise à jour du code d'example (adaptation au nouveau style des slides)

  • Participants
  • Parent commits d658cbc

Comments (0)

Files changed (8)

File free-docs/tppoo/docs/examples/org/esme/samples/AsynchronousEngine.java

 
 /**
  * This class represents an Asynchronous Engine,
- * which a quite complex ( almost impossible ? ;)
- * engine to understand for a students at Esme...
- *
  */
 public class AsynchronousEngine {
-	// Represents how many coils has the engine
-	private final static int NB_COILS = 10;
-	// Represents the maximum output current
-	public final static int MAX_CURRENT = 100;
+   // Represents how many coils has the engine
+   private final static int NB_COILS = 10;
+   // Represents the maximum output current
+   public final static int MAX_CURRENT = 100;
 }

File free-docs/tppoo/docs/examples/org/esme/samples/Checksumable.java

 package org.esme.samples;
 
-public interface Checksumable {
+interface Checksumable {
   public int checksum();
 }

File free-docs/tppoo/docs/examples/org/esme/samples/Developer.java

 
 public class Developer {
   /**
-   * When the developer is working on a project, this method is called.
-   * @throws ProjectException is thrown if the all project is encountering
-   *       some great difficulties.
-   */
+   * Call this when a developer is working...
+   * @throws ProjectException, issues related to 
+   *  management of the project is not the 
+   *  responsability of the developer. */
   public void doingAProject() throws ProjectException {
-    try {
-      // During a projet, a developer is supposed to code !
-      this.code();
-    }
-    catch ( TechnicalException e ) { //
-      // Taking care of technical difficulties is
-      // the developer's job:
-      this.doingSomethingAppropriate(e);
-    }
+   try {
+     this.code();
+   }
+   catch ( TechnicalException e ) { //
+     // Taking care of technical isssues is
+     // of the developer responsability.
+     this.doingSomethingAppropriate(e);
+   }
   }
 
 

File free-docs/tppoo/docs/examples/org/esme/samples/InterfaceUsage.java

     List<Checksumable> items;
     items = new ArrayList<Checksumable>(2);
     items.add(new MyFile());
-    		// MyFile extends File
-            // and implements Checksumable
+// MyFile extends File and implements Checksumable
     items.add(new User());
-    		// User also implements Checksumable
+// User also implements Checksumable
     for ( Checksumable item : items ) {
       System.out.println(item.checksum());
     }

File free-docs/tppoo/docs/examples/org/esme/samples/LooseCoupling.java

 package org.esme.samples;
 
-// Illustration of the loose coupling...
 public class LooseCoupling {
-	// This class can use ANY object implementing
-	// the Checksumable interface...
-	private Checksumable field;
+// This class can use ANY object implementing
+// the Checksumable interface...
+   private Checksumable field;
 
-	public LooseCoupling(Checksumable field) {
-		this.field = field;
-	}
+   public LooseCoupling(Checksumable field) {
+      this.field = field;
+   }
 }

File free-docs/tppoo/docs/examples/org/esme/samples/LooseCouplingExample.java

 package org.esme.samples;
 
 public class LooseCouplingExample {
-	public void usingMyFileOrUser(){
-		LooseCoupling obj;
-		obj = new LooseCoupling(new MyFile());
-		LooseCoupling other;
-		other = new LooseCoupling(new User());
-	}
+   public void usingMyFileOrUser(){
+      LooseCoupling obj;
+      obj = new LooseCoupling(new MyFile());
+      LooseCoupling other;
+      other = new LooseCoupling(new User());
+   }
 }

File free-docs/tppoo/docs/examples/org/esme/samples/MapUsage.java

 import java.util.Map;
 
 public class MapUsage {
-	public void usingMap() {
-		Map<String,Object> map;
-		map = new HashMap<String,Object>(3);
-		map.put("key","value");
-		System.out.println(map.get("value"));
-	}
+   public void usingMap() {
+      Map<String,Object> map;
+      map = new HashMap<String,Object>(3);
+      map.put("key","value");
+      System.out.println(map.get("value"));
+   }
 }

File free-docs/tppoo/docs/examples/org/esme/samples/MilkBottle.java

 package org.esme.samples;
 
 public class MilkBottle {
-	float quantity;	// represents the amount of milk
-					// in the bottle.
+   float quantity;   // represents the amount
+         // of milk in the bottle.
 
-	public void add(MilkBottle otherBottle) {
-		this.quantity += otherBottle.quantity;
-	}
+   public void add(MilkBottle otherBottle) {
+      this.quantity += otherBottle.quantity;
+   }
 }