add AO the base
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
package impl;
|
package impl;
|
||||||
|
|
||||||
public class Afficheur {
|
import interfaces.Capteur;
|
||||||
|
import interfaces.ObserverdeCapteur;
|
||||||
|
|
||||||
|
public class Afficheur implements ObserverdeCapteur {
|
||||||
|
//AO1 - concrete servant
|
||||||
|
@Override
|
||||||
|
public void update(Capteur subject) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
package impl;
|
package impl;
|
||||||
|
|
||||||
public class Canal {
|
import interfaces.Capteur;
|
||||||
|
import interfaces.CapteurAsync;
|
||||||
|
import interfaces.ObserverDeCapteurAsync;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
public class Canal implements ObserverDeCapteurAsync, CapteurAsync {
|
||||||
|
//AO1 - proxy
|
||||||
|
@Override
|
||||||
|
public Future<?> update(Capteur c) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//AO2 - proxy
|
||||||
|
@Override
|
||||||
|
public Future<Integer> getValue() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,28 @@
|
|||||||
package impl;
|
package impl;
|
||||||
|
|
||||||
public class CapteurImpl {
|
import interfaces.Capteur;
|
||||||
|
import interfaces.Observer;
|
||||||
|
|
||||||
|
public class CapteurImpl implements Capteur {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attach(Observer o) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detach(Observer o) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//AO2 - Concrete Servant
|
||||||
|
@Override
|
||||||
|
public int getValue() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
src/impl/GetValue.java
Normal file
11
src/impl/GetValue.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package impl;
|
||||||
|
|
||||||
|
import interfaces.MethodInvocation;
|
||||||
|
|
||||||
|
public class GetValue implements MethodInvocation {
|
||||||
|
//AO2 - concrete MI
|
||||||
|
@Override
|
||||||
|
public void call() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/impl/Update.java
Normal file
11
src/impl/Update.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package impl;
|
||||||
|
|
||||||
|
import interfaces.MethodInvocation;
|
||||||
|
|
||||||
|
public class Update implements MethodInvocation {
|
||||||
|
//AO1 - concrete MI
|
||||||
|
@Override
|
||||||
|
public void call() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package interfaces;
|
package interfaces;
|
||||||
|
|
||||||
public interface AlgoDiffusion {
|
public interface AlgoDiffusion {
|
||||||
public void configure();
|
public void configure();
|
||||||
public void execture();
|
|
||||||
|
public void execture();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package interfaces;
|
|||||||
public interface Capteur {
|
public interface Capteur {
|
||||||
public void attach(Observer o);
|
public void attach(Observer o);
|
||||||
public void detach(Observer o);
|
public void detach(Observer o);
|
||||||
public int getValue();
|
|
||||||
public void tick();
|
public void tick();
|
||||||
|
|
||||||
|
//AO2 - servant
|
||||||
|
int getValue();
|
||||||
}
|
}
|
||||||
|
|||||||
8
src/interfaces/CapteurAsync.java
Normal file
8
src/interfaces/CapteurAsync.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package interfaces;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
public interface CapteurAsync {
|
||||||
|
//AO2 - service
|
||||||
|
Future<Integer> getValue();
|
||||||
|
}
|
||||||
6
src/interfaces/Future.java
Normal file
6
src/interfaces/Future.java
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package interfaces;
|
||||||
|
|
||||||
|
public interface Future<T> {
|
||||||
|
T get();
|
||||||
|
boolean isDone();
|
||||||
|
}
|
||||||
5
src/interfaces/MethodInvocation.java
Normal file
5
src/interfaces/MethodInvocation.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package interfaces;
|
||||||
|
|
||||||
|
public interface MethodInvocation {
|
||||||
|
void call();
|
||||||
|
}
|
||||||
8
src/interfaces/ObserverDeCapteurAsync.java
Normal file
8
src/interfaces/ObserverDeCapteurAsync.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package interfaces;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
public interface ObserverDeCapteurAsync {
|
||||||
|
//AO1 - service
|
||||||
|
Future<?> update(Capteur c);
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package interfaces;
|
package interfaces;
|
||||||
public interface ObserverdeCapteur extends Observer<Capteur>{
|
public interface ObserverdeCapteur extends Observer<Capteur>{
|
||||||
|
//AO1 - servant
|
||||||
@Override
|
@Override
|
||||||
public void update(Capteur subject);
|
public void update(Capteur subject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user