SlideShare une entreprise Scribd logo
1  sur  110
Télécharger pour lire hors ligne
1
DESIGN PATTERNS
BY
RENAUD HOYOUX
2 . 1
ABOUT ME
Architecton Cytomine.
2 . 2
Benevolent Dictator of the non-pro t organization Kodo
Wallonie.
ABOUT ME
2 . 3
Coach at CoderDojo Liège.
ABOUT ME
3
DESIGN PATTERNS
In software engineering, a design pattern is a general
repeatable solution to a commonly occurring problem in
software design. A design pattern isn't a nished design that
can be transformed directly into code. It is a description or
template for how to solve a problem that can be used in many
different situations.
4 . 1
OBJECT ORIENTED PROGRAMMING
Inheritance
Composition
Polymorphism
4 . 2
INHERITANCE
class Sandwich {
  private int weight;
  public void eat() { System.out.println("Miam"); }
  public void buy() { System.out.println("it costs X euros"); }
}
class GASandwich extends Sandwich {
  public void share() {
    System.out.println("I always share when it's not mine");
  }
  @Override
  public void buy() {
    System.out.println("Free as in beer not as in speech");
  }
}
GASandwich tuna = new GASandwich();
tuna.buy();
tuna.share();
//I can call eat because I inherit from the Sandwich class
tuna.eat();
4 . 3
has-a relationship in classes.
COMPOSITION
public class GAEvent {
  private List<GASandwich>;
  // ...
}
Every (good) GAEvent has GASandwiches.
4 . 4
POLYMORPHISM
Sandwich ham = new GASandwich();
ham.eat();
ham.buy();
// but I can't call ham.share();
public void doTheRightThing(Sandwich food){
  food.buy();
  food.eat();
}
Sandwich ham = new GASandwich();
// Yep ! It's work
doTheRightThing(ham);
5
GANG OF FOUR
Creationnal patterns :
Singleton, Factory Method, Abstract Factory, Prototype,
Builder.
Structural patterns :
Proxy, Flyweight, Bridge, Facade, Decorator, Adapter,
Composite.
Behavioral patterns :
Observer, Template Method, Command, Iterator, State,
Mediator, Strategy, Chain of Responsibility, Visitor,
Interpreter, Memento.
6
GANG OF FOUR
Creationnal patterns :
Singleton, Factory Method, Abstract Factory, Prototype,
Builder.
7 . 1
Ensure a class only has one instance, and provide a global
point of access to it.
SINGLETON
public class Singleton {
   private static Singleton singleton;
   //prevent the use of the new keyword
   private Singleton() {}
   public static synchronized Singleton getSingleton(){
      if(singleton == null){
         singleton = new Singleton();
      }
      return singleton;
   }
}
7 . 2
7 . 3
Java Optimisation : Bill Pugh Singleton Implementation
public class BillPughSingleton {
    private BillPughSingleton(){}
    
    private static class SingletonHelper{
        private static final BillPughSingleton INSTANCE
 = new BillPughSingleton();
    }
    
    public static BillPughSingleton getInstance(){
        return SingletonHelper.INSTANCE;
    }
}
8 . 1
De ne an interface for creating an object but let subclasses
decide which class to instanciate. The factory method lets a
class defer instantiation to subclasses.
FACTORY METHOD
8 . 2
Basically, we create object without exposing the creation
logic and refer to newly created object using a common
interface.
interface DatabaseConnector {
   void openConnection();
   Result executeQuery(String query);
   void closeConnection();
}
public class MySQLConnector implements DatabaseConnector {
   @Override
   public void openConnection() { /* ... */ }
   @Override
   public Result executeQuery(String query) { /* ... */ }
   @Override
   public void closeConnection() { /* ... */ }
   //...
}
public class PostgreSQLConnector implements DatabaseConnector {
      //...
}
public class MongoDBConnector implements DatabaseConnector {
      //...
}
8 . 3
public class DatabaseConnectorFactory {
   public DatabaseConnector getDatabaseConnector(String database){
      if(database.equals(DB.MONGO)){
         return new MongoDBConnector();
 
      } else if(database.equals(DB.POSTGRES)){
         return new PostgreSQLConnector();
      } else if(database.equals(DB.MYSQL)){
         return new MySQLConnector();
      }
   }
}
8 . 4
String database = CONFIG.database;
DatabaseConnector connector = factory.getDatabaseConnector(database);
connector.openConnection();
Result result = connector.executeQuery(
                             "SELECT * sandwiches WHERE NOT rotten");
//...
connector.closeConnection();
8 . 5
9 . 1
Provides an interface for creating families of related or
dependent objects without specifying their concrete classes.
This pattern provides an encapsulation mechanism to a group
of individual factories with a common theme.
ABSTRACT FACTORY
interface DatabaseConnector {
   void openConnection();
   Result executeQuery();
   void closeConnection();
}
interface SQLConnector extends DatabaseConnector {}
interface DocumentOrientedConnector extends DatabaseConnector {}
9 . 2
public abstract class DatabaseConnectorFactory {
   String dbHost;
   int dbPort;
   public abstract DatabaseConnector getDatabaseConnector(
String database);
}
9 . 3
public class DocumentOrientedConnectorFactory 
extends DatabaseConnectorFactory {
   @Override
   public DocumentOrientedConnector getDatabaseConnector(
      String database){
      if(database.equals(DB.MONGO)){
         return new MongoDBConnector();
 
      } else if(database.equals(DB.COUCHDB)){
         return new CouchDBConnector();
      }
   }
}
public class SQLConnectorFactory extends DatabaseConnectorFactory {
   @Override
   public SQLConnector getDatabaseConnector(String database){
      if(database.equals(DB.POSTGRES)){
         return new PostgreSQLConnector();
 
      } else if(database.equals(DB.MYSQL)){
         return new MySQLConnector();
      }
   }
}
9 . 4
DatabaseConnectorFactory factory;
if(sql) {
   factory = new SQLConnectorFactory();
} else {
   factory = new DocumentOrientedConnectorFactory();
}
DatabaseConnector connector = factory.getDatabaseConnector(database);
connector.openConnection();
//...
9 . 5
10 . 1
Specify the kinds of objects to create using a prototypical
instance, and create new objects by copying this prototype.
PROTOTYPE
public class NPC implements Cloneable {
   //skin, etc.
   //complex constructor
   //NB : deep copy is better
   public Object clone() {
      Object clone = null;
      
      try {
         clone = super.clone();
         
      } catch (CloneNotSupportedException e) {
         e.printStackTrace();
      }
      
      return clone;
   }
}
10 . 2
public class NPCCache {
   private static Hashtable<String, NPC> npcMap  = new Hashtable<>();
   public static NPC getNPC(String id) {
      NPC cachedNPC = npcMap.get(id);
      return (NPC) cachedNPC.clone();
   }
   // Or you can instanciate Objects only when you need them 
   // for the first time.
   public static void loadCache() {
      NPC npc = new NPC(/* ... */);
      npcMap.put("walker",npc);
      //...
   }
}
10 . 3
NPCCache.loadCache();
NPC clonedNPC = NPCCache.getNPC("walker");
// change only skin, x, y & dialogs
10 . 4
11 . 1
Separate the construction of a complex object from its
representation so that the same construction processes can
create different representations.
BUILDER
public class Image {
   
   private byte[] bytes;
   private ArrayList<MetaData> metadatas;
   // setters & getters
}
11 . 2
public abstract class ImageBuilder {
   
   private byte[] bytes;
   private ArrayList<MetaData> metadatas;
   // setters & getters
   public abstract Image createImage(); 
}
11 . 3
public class JpegBuilder extends ImageBuilder {
   
   public void setCompressionRatio(){
      //...
   }
   @Override
   public Image createImage(){
      //set metadatas & bytes with the good compression & specifications
   }
}
public class Jpeg2000Builder extends ImageBuilder {
   //...
}
public class PngBuilder extends ImageBuilder {
   //...
}
11 . 4
12
GANG OF FOUR
Structural patterns :
Proxy, Flyweight, Bridge, Facade, Decorator, Adapter,
Composite.
13 . 1
Provide a surrogate or placeholder for another object to
control access to it.
PROXY
13 . 2
We create object having original object to interface its
functionality to outer world.
interface Image {
   void display();
}
public class RealImage implements Image {
   private String fileName;
   public RealImage(String fileName){
      this.fileName = fileName;
      loadFromDisk(fileName);
   }
   @Override
   public void display() {
      System.out.println("Displaying " + fileName);
   }
}
public class ProxyImage implements Image{
   private RealImage realImage;
   private String fileName;
   @Override
   public void display() {
      if(realImage == null){
         realImage = new RealImage(fileName);
      }
      realImage.display();
   }
}
13 . 3
Image image = new ProxyImage("test_10mb.jpg");
//image will be loaded from disk
image.display(); 
System.out.println("");
      
//image will not be loaded from disk
image.display();
13 . 4
14 . 1
Use sharing to support large numbers of ne grained objects
ef ciently.
FLYWEIGHT
Flyweight pattern tries to reuse already existing similar kind
objects by storing them and creates new object only when no
matching object is found.
14 . 2
Example : In a Role Playing Game, we have salesman Non
Playable Characters :
They don't move.
Event reactions are the same.
Only speci c caracteristics (prices, items, skin) vary.
public class NPC {
   //skin, etc.
}
public class SalesmanNPC extends NPC { /* ... */ }
14 . 3
public class NPCFactory {
   private static final HashMap<String, NPC> memo = new HashMap();
   public static NPC getNPC(String type) {
      NPC npc = memo.get(type);
      if(npc == null) {
         npc = new NPC(/*...*/); // or SalesmanNPC ...
         memo.put(type, npc);
      }
      return npc;
   }
}
14 . 4
SalesmanNPC npc = (SalesmanNPC) NPCFactory.getNPC("salesman");
// set X & Y, dialog, items
npc.draw();
14 . 5
15 . 1
Decouple an abstraction from its implementation so that the
two can vary independently
BRIDGE
Prefer composition over inheritance.
15 . 2
interface IColor {
  void fill();
}
public class Red implements IColor {
  @Override
  public void fill(){
    System.out.println("fill shape with red color");
  }
}
public class Green implements IColor {
  @Override
  public void fill(){
    System.out.println("fill shape with green color");
  }
}
15 . 3
public abstract class Shape {
  // Composition
  protected IColor color;
  public abstract void draw();
}
public class Triangle extends Shape {
  @Override
  public void draw(){
    System.out.print("Draw triangle and ");
  }
}
public class Square extends Shape {
  @Override
  public void draw(){
    System.out.print("Draw square and ");
  }
}
15 . 4
Shape triangle = new Triangle(new Green());
triangle.draw();
Shape square = new Square(new Red());
square.draw();
Draw triangle and fill shape with green color
Draw square and fill shape with red color
15 . 5
16 . 1
Provide a uni ed interface to a set of interfaces in a system.
Facade de nes a higher-level interface that makes the
subsystem easier to use. this pattern adds an interface to
existing system to hide its complexities.
FACADE
16 . 2
Facade pattern hides the complexities of the system by
involving a single class which provides simpli ed methods
required by client and delegates calls to methods of existing
system classes.
This is the basic principle of an API...
17 . 1
Attach additionnal responsibilities to an object dynamically.
Decorators provide a exible alternative to subclassing for
extending functionality.
DECORATOR
Instead of modifying the existing functionalities, we will
extend them.
One class takes in another class, both of which extend the
same abstract class, and adds functionality.
interface Shape {
   void draw();
}
public class Rectangle implements Shape {
   @Override
   public void draw() {
      System.out.println("Shape: Rectangle");
   }
}
public class Square implements Rectangle {
   @Override
   public void draw() {
      System.out.println("Shape: Square");
   }
}
17 . 2
public abstract class ShapeDecorator implements Shape {
   protected Shape decoratedShape;
   public ShapeDecorator(Shape decoratedShape){
      this.decoratedShape = decoratedShape;
   }
   public abstract void draw();
}
17 . 3
public class RedBorderShape extends ShapeDecorator {
   public RedBorderShape(Shape decoratedShape) {
      super(decoratedShape);
   }
   @Override
   public void draw() {
      decoratedShape.draw();
      setRedBorder(decoratedShape);
   }
   //...
}
public class SmoothBorderShape extends ShapeDecorator {
   public SmoothBorderShape(Shape decoratedShape) {
      super(decoratedShape);
   }
   @Override
   public void draw() {
      decoratedShape.draw();
      setSmooothBorder(decoratedShape);
   }
   //...
}
17 . 4
//A simple square
Shape square = new Square();
square.draw();
//A red square
Shape redSquare = new RedBorderShape(square);
redSquare.draw();
//A rectangle with smooth border
Shape smoothRectangle = new SmoothBorderShape(new Rectangle());
smoothRectangle.draw();
//Even a red rectangle with smooth border
Shape redSmoothRectangle = new SmoothBorderShape(
new RedBorderShape(
new Rectangle()));
redSmoothRectangle.draw();
17 . 5
17 . 6
Real example :
//First open an inputstream of it:
FileInputStream fis = new FileInputStream("/objects.gz");
//We want speed, so let's buffer it in memory:
BufferedInputStream bis = new BufferedInputStream(fis);
//The file is gzipped, so we need to ungzip it:
GzipInputStream gis = new GzipInputStream(bis);
//we can now use the read method.
18 . 1
Convert the interface of a class into another interface that
client expect. The adapter pattern lets classes work together
that couldn't otherwise because of incompatible interfaces.
ADAPTER
interface MediaPlayer {
   void play(String audioType, String fileName);
}
interface AdvancedMediaPlayer {
   void play(String fileName);
}
18 . 2
public class VlcPlayer implements AdvancedMediaPlayer{
   @Override
   public void play(String fileName) {
      System.out.println("Playing vlc file. Name: "+ fileName);
   }
}
public class Mp4Player implements AdvancedMediaPlayer{
   @Override
   public void play(String fileName) {
      System.out.println("Playing mp4 file. Name: "+ fileName);
   }
}
18 . 3
public class MediaAdapter implements MediaPlayer {
   AdvancedMediaPlayer advancedMusicPlayer;
   public MediaAdapter(String audioType){
      if(audioType.equalsIgnoreCase("vlc") ){
         advancedMusicPlayer = new VlcPlayer();
      } else if (audioType.equalsIgnoreCase("mp4")){
         advancedMusicPlayer = new Mp4Player();
      }
   }
   @Override
   public void play(String audioType, String fileName) {
      advancedMusicPlayer.play(fileName);
   }
}
18 . 4
public class AudioPlayer implements MediaPlayer {
   MediaAdapter mediaAdapter;
   @Override
   public void play(String audioType, String fileName) {
      //inbuilt support to play mp3 music files
      if(audioType.equalsIgnoreCase("mp3")){
         System.out.println("Playing mp3 file. Name: " + fileName);
      }
      //mediaAdapter is providing support to play other file formats
      else if(audioType.equalsIgnoreCase("vlc")
|| audioType.equalsIgnoreCase("mp4")){
         mediaAdapter = new MediaAdapter(audioType);
         mediaAdapter.play(audioType, fileName);
      } //else ...
   }
}
18 . 5
AudioPlayer audioPlayer = new AudioPlayer();
audioPlayer.play("mp3", "beyond the horizon.mp3");
audioPlayer.play("mp4", "alone.mp4");
audioPlayer.play("vlc", "far far away.vlc");
audioPlayer.play("avi", "mind me.avi");
18 . 6
19 . 1
Compose objects into tree structures to represent part-
whole hierarchies. The composite pattern lets client treat
individual objects and compositions of objects uniformly.
COMPOSITE
19 . 2
Example : File in Java
public class Employee {
   private String name;
   //...
   private List<Employee> subordinates = new ArrayList<>();
   public void add(Employee e) {
      subordinates.add(e);
   }
   public void remove(Employee e) {
      subordinates.remove(e);
   }
   public List<Employee> getSubordinates(){
     return subordinates;
   }
}
19 . 3
20
GANG OF FOUR
Behavioral patterns :
Observer, Template Method, Command, Iterator, State,
Mediator, Strategy, Chain of Responsibility, Visitor,
Interpreter, Memento.
21 . 1
De ne a one-to-many dependency between objects so that
when one object changes state, all its dependents are noti ed
and updated automatically.
OBSERVER
21 . 2
Example : A Graphical User Interface with 3 visualizations of
a number : binary, octal and hexadecimal. Whenever the
number changes, these visualizations must change too.
interface IObserver<T> {
void update(T i);
}
interface IObservable<T> {
   void attach(IObserver observer);
   //void remove(IObserver observer);
   //void clean();
   //...
   public void notifyAllObservers(T state);
}
21 . 3
class Subject implements IObservable<Integer> {
   private List<IObserver> observers = new ArrayList<IObserver>();
   private int state;
   public void setState(int state) {
      this.state = state;
      notifyAllObservers(this.state);
   }
   public void attach(IObserver observer){
      observers.add(observer);
   }
   public void notifyAllObservers(Integer state){
      for (IObserver observer : observers) {
         observer.update(state);
      }
21 . 4
class BinaryObserver implements IObserver<Integer>{
   @Override
   public void update(Integer i) {
      System.out.println("Binary String: "+Integer.toBinaryString(i)); 
   }
}
class HexaObserver implements IObserver<Integer>{
   @Override
   public void update(Integer i) {
      System.out.println("Hex String: "+Integer.toHexString(i)
                                                  .toUpperCase()); 
   }
}
21 . 5
Subject subject = new Subject();
subject.attach(new BinaryObserver());
subject.attach(new HexaObserver());
System.out.println("First state change: 15");
subject.setState(15);
System.out.println("Second state change: 10");
subject.setState(10);
First state change: 15
Binary String: 1111
Hex String: F
Second state change: 10
Binary String: 1010
Hex String: A
21 . 6
21 . 7
A FUNCTIONAL INTERFACE
@FunctionalInterface
interface IObserver<T> {
void update(T i);
}
Subject subject = new Subject();
subject.attach(i ­> {
  System.out.println("Binary String: "+Integer.toBinaryString(i));
});
subject.attach(i ­> {
  System.out.println("Hex String: "+Integer.toHexString(i)
                                                  .toUpperCase());
});
System.out.println("First state change: 15");
subject.setState(15);
System.out.println("Second state change: 10");
subject.setState(10);
22 . 1
De ne the skeleton of an algorithm in an operation, deferring
some steps to subclasses. The template method lets
subclasses rede ne certains steps of an algorithm without
changing the algorithm's structure.
TEMPLATE METHOD
22 . 2
Well ... It's the purpose of an abstract class.
23 . 1
Encapsulate a request as an object, thereby letting you
parameterize clients with different requests, queue or log
request, and support undoable operations.
COMMAND
23 . 2
Data Driven pattern
class Stock {
   private String name = "ABC";
   private int quantity = 10;
   public void buy(){
      System.out.println("Stock : "+quantity+" "+name+" bought");
   }
   public void sell(){
      System.out.println("Stock : "+quantity+" "+name+" sold");
   }
}
23 . 3
interface Order {
   void execute();
}
abstract class StockOrder implements Order {
   protected Stock stock;
   abstract void execute();
}
23 . 4
class BuyStock extends StockOrder {
   public BuyStock(Stock stock){
      this.stock = stock;
   }
   public void execute() {
      stock.buy();
   }
}
class SellStock extends StockOrder {
   public SellStock(Stock stock){
      this.stock = stock;
   }
   public void execute() {
      stock.sell();
   }
}
23 . 5
class Broker {
   private List<Order> orderList = new ArrayList<Order>(); 
   public void takeOrder(Order order){
      orderList.add(order);
   }
   public void placeOrders(){
   
      for (Order order : orderList) {
         order.execute();
      }
      orderList.clear();
   }
}
Stock abcStock = new Stock();
BuyStock buyStockOrder = new BuyStock(abcStock);
SellStock sellStockOrder = new SellStock(abcStock);
Broker broker = new Broker();
broker.takeOrder(buyStockOrder);
broker.takeOrder(sellStockOrder);
broker.placeOrders();
23 . 6
24 . 1
Provide a way to access the elements of an aggregate object
sequentially without exposing its underlying representation.
ITERATOR
The concerned classes (ex : People) return a subclasse
(PeopleIterator) which implements the Iterator interface.
interface Iterator<T> {
   boolean hasNext();
   T next();
   //first();
   // ... 
}
24 . 2
24 . 3
Remember : In Java,
List are Iterable<T>.
Set are Iterable<T>.
Arrays are not even if the foreach is well de ned.
ArrayList<String> list = new ArrayList<>();
String[] array = new String[1];
list.add("test1")
array[0] = "test1"
list.add("test2")
array[1] = "test2"
for(String s : list){
System.out.println(s);
}
for(String s : array){
System.out.println(s);
}
25 . 1
Allow an object to alter its behaviour when its internal state
changes. The object will appear to change its class.
STATE
Example : Screen in a video game
public abstract class State {
   public abstract void switch(TV context);
}
public class Off extends State {
   @Override
   public void switch(TV context){
      context.setState(new On());
   }
}
public class On extends State {
   @Override
   public void switch(TV context){
      context.setState(new Off());
   }
}
25 . 2
public class TV {
   public State state;
   public void setState(State state) {
      this.state = state;
   }
   public void pressButton(){
      state.switch(this);
   }
}
Off initialState = new Off();
TV tv = new TV(initialState);
//press
tv.pressButton();
//again
tv.pressButton();
25 . 3
26 . 1
De ne an object that encapsulates how a set of objects
interacts. The mediator pattern promotes loose coupling by
keeping objects from referring to each other explicitly, and it
lets you vary their interaction independently.
MEDIATOR
public class Person {
   protected Mediator mediator;
   public void send(String msg){
      mediator.send(this, msg);
   }
   public void notify(String msg){
      System.out.println(msg);
   }
}
public class Boss extends Person {}
26 . 2
public class Mediator {
   private List<Person> people;
   private Boss boss;
   // ...
   public void send(Person from, String msg){
      if(from instanceof Boss){
         for(Person p : people) p.notify("Boss says : "+msg);
      } else {
         boss.notify(from +" : "+msg);
      }
   }
}
26 . 3
27 . 1
De ne a family of algorithms, encapsulate each one, and
make them interchangeable. The strategy pattern lets the
algorithm vary independently from client to client.
STRATEGY
interface Strategy {
   Path shortestPath(Graph graph, Node begin, Node end);
}
public class Dijkstra implements Strategy{
   @Override
   public Path shortestPath(Graph graph, Node begin, Node end) {
      //...
   }
}
public class AStar implements Strategy{
   @Override
   public Path shortestPath(Graph graph, Node begin, Node end) {
      //...
   }
}
27 . 2
public class GraphManager {
   private Graph graph;
   private Strategy strategy;
   public GraphManager(Strategy strategy){
      this.strategy = strategy;
   }
   //set strategy
   public int executeStrategy(Node begin, Node end){
      return strategy.shortestPath(this.graph, begin, end);
   }
}
GraphManager context = new GraphManager(new Dijkstra());
context.executeStrategy(begin, end);
context.setStrategy(new AStar());
context.executeStrategy(begin, end);
27 . 3
28 . 1
Avoid coupling the sender of a request to its receiver by
giving more than one object a chance to handle the request.
Chain the receiving objects and pass the request along the
chain until an object handles it.
CHAIN OF RESPONSIBILITY
public abstract class AbstractLogger {
   public static int INFO = 1;
   public static int DEBUG = 2;
   public static int ERROR = 3;
   protected int level;
   protected AbstractLogger nextLogger;
   public void logMessage(int level, String message){
      if(this.level <= level){
         write(message);
      }
      if(nextLogger !=null){
         nextLogger.logMessage(level, message);
      }
   }
28 . 2
public class ConsoleLogger extends AbstractLogger {
   public ConsoleLogger(int level){
      this.level = level;
   }
   @Override
   protected void write(String message) {
      System.out.println("Standard Console::Logger: " + message);
   }
}
public class ErrorLogger extends AbstractLogger {
   public ErrorLogger(int level){
      this.level = level;
   }
   @Override
   protected void write(String message) {
      System.out.println("Error Console::Logger: " + message);
   }
}
28 . 3
//creation
AbstractLogger loggerChain = new ErrorLogger(AbstractLogger.ERROR);
AbstractLogger fileLogger = new FileLogger(AbstractLogger.DEBUG);
AbstractLogger consoleLogger = new ConsoleLogger(AbstractLogger.INFO);
//chaining
loggerChain.setNextLogger(fileLogger);
fileLogger.setNextLogger(consoleLogger);
loggerChain.logMessage(AbstractLogger.INFO, 
         "This is an information.");
loggerChain.logMessage(AbstractLogger.DEBUG, 
         "This is an debug level information.");
loggerChain.logMessage(AbstractLogger.ERROR, 
         "This is an error information.");
28 . 4
29 . 1
Represent an operation to be performed on the elements of
an object structure. The visitor pattern lets you de ne a new
operation without changing the classes of the elements on
which it operates.
VISITOR
interface Visitable{
  void accept(Visitor visitor);
}
public class Book implements Visitable{
  private double price;
  private double weight;
  public double getPrice() {
    return price;
  }
  public double getWeight() {
    return weight;
  }
  //accept the visitor
  @Override
  public void accept(Visitor vistor) {
    visitor.visit(this);
  }
}
29 . 2
interface Visitor{
  void visit(Visitable visitable);
}
public class PostageVisitor implements Visitor {
  private double totalPostageForCart;
  public double getTotalPostage() {
    return totalPostageForCart;
  }
  //collect data about the book
  @Override
  public void visit(Visitable visitable) {
    if(Visitable instanceof Book) {
      //assume we have a calculation here related to weight and price
      //free postage for a book over 10 
      if(book.getPrice() < 10.0) {
        totalPostageForCart += book.getWeight() * 2;
      }
    }
    // else ... other visitables
29 . 3
public class ShoppingCart {
  //normal shopping cart stuff
  private ArrayList<Visitable> items;
  public double calculatePostage() {
    //create a visitor
    PostageVisitor visitor = new PostageVisitor();
    //iterate through all items
    for(Visitable item: items) {
      item.accept(visitor);
    }
    double postage = visitor.getTotalPostage();
    return postage;
  }
}
29 . 4
30 . 1
Given a language, de ne a representation for its grammar
along with an interpreter that uses the representation to
interpret sentences in the language.
INTERPRETER
Example : SQL parsing
interface Expression {
   boolean interpret(String context);
}
public class TerminalExpression implements Expression {
   private String data;
   public TerminalExpression(String data){
      this.data = data; 
   }
   @Override
   public boolean interpret(String context) {
      if(context.contains(data)){
         return true;
      }
      return false;
   }
}
30 . 2
public class OrExpression implements Expression {
   private Expression expr1 = null;
   private Expression expr2 = null;
   public OrExpression(Expression expr1, Expression expr2) { 
      this.expr1 = expr1;
      this.expr2 = expr2;
   }
   @Override
   public boolean interpret(String context) {
      return expr1.interpret(context) || expr2.interpret(context);
   }
}
public class AndExpression implements Expression {
   private Expression expr1 = null;
   private Expression expr2 = null;
   public AndExpression(Expression expr1, Expression expr2) { 
      this.expr1 = expr1;
      this.expr2 = expr2;
   }
   @Override
   public boolean interpret(String context) {
      return expr1.interpret(context) && expr2.interpret(context);
   }
}
30 . 3
public class InterpreterPatternDemo {
   //Rule: Robert and John are male
   public static Expression getMaleExpression(){
      Expression robert = new TerminalExpression("Robert");
      Expression john = new TerminalExpression("John");
      return new OrExpression(robert, john);
   }
   //Rule: Julie is a married women
   public static Expression getMarriedWomanExpression(){
      Expression julie = new TerminalExpression("Julie");
      Expression married = new TerminalExpression("Married");
      return new AndExpression(julie, married);
   }
   public static void main(String[] args) {
      Expression isMale = getMaleExpression();
30 . 4
31 . 1
Without violating encapsulation, capture and externalize an
object's internal state so that the object can be restored to
this state later.
MEMENTO
public class Memento<T> {
   private T state;
   public Memento(T state){
      this.state = state;
   }
   public T getState(){
      return state;
   }
}
31 . 2
public class Originator {
   //all internal states
   // ...
   public Memento<Originator> saveToMemento(){
      //...
   }
   public void restoreFromMemento(Memento<Originator> memento){
      //...
   }
}
public class CareTaker {
   private List<Memento<Originator>> mementoList = new ArrayList<>();
   public void add(Memento<Originator> state){
      mementoList.add(state);
   }
   public Memento<Originator> get(int index){
      return mementoList.get(index);
   }
}
31 . 3
Originator originator = new Originator();
CareTaker careTaker = new CareTaker();
      
// originator changes;
careTaker.add(originator.saveToMemento());
// originator changes;
careTaker.add(originator.saveToMemento());
// originator changes;
originator.restoreFromMemento(careTaker.get(0));
31 . 4
32
ARCHITECTURAL PATTERNS
Data Access Object
MVC
Multitier
Microservices
Message-driven architecture
...
33
@TheGeekTortoise

Contenu connexe

Similaire à Mieux programmer grâce aux design patterns

27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examplesQuang Suma
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016Przemek Jakubczyk
 
Java design patterns
Java design patternsJava design patterns
Java design patternsShawn Brito
 
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...Constanța Developers
 
Software System Architecture-Lecture 6.pptx
Software System Architecture-Lecture 6.pptxSoftware System Architecture-Lecture 6.pptx
Software System Architecture-Lecture 6.pptxssuser9a23691
 
Creational pattern 2
Creational pattern 2Creational pattern 2
Creational pattern 2Naga Muruga
 
Design Patterns
Design PatternsDesign Patterns
Design Patternsadil raja
 
Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016Przemek Jakubczyk
 
PHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodePHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodeSWIFTotter Solutions
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3Naga Muruga
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC PrinciplesPavlo Hodysh
 
20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction20.4 Java interfaces and abstraction
20.4 Java interfaces and abstractionIntro C# Book
 
Content Staging in Drupal 8
Content Staging in Drupal 8Content Staging in Drupal 8
Content Staging in Drupal 8Dick Olsson
 
Core Java- An advanced review of features
Core Java- An advanced review of featuresCore Java- An advanced review of features
Core Java- An advanced review of featuresvidyamittal
 

Similaire à Mieux programmer grâce aux design patterns (20)

27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016
 
Builder design pattern
Builder design patternBuilder design pattern
Builder design pattern
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...
Andrei Iacob - SOLID: Strategies for Implementing Object–Oriented Design Prin...
 
Software System Architecture-Lecture 6.pptx
Software System Architecture-Lecture 6.pptxSoftware System Architecture-Lecture 6.pptx
Software System Architecture-Lecture 6.pptx
 
Creational Design Patterns
Creational Design PatternsCreational Design Patterns
Creational Design Patterns
 
Creational pattern 2
Creational pattern 2Creational pattern 2
Creational pattern 2
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016Droidcon Berlin Barcamp 2016
Droidcon Berlin Barcamp 2016
 
PHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodePHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better Code
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC Principles
 
20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction20.4 Java interfaces and abstraction
20.4 Java interfaces and abstraction
 
Content Staging in Drupal 8
Content Staging in Drupal 8Content Staging in Drupal 8
Content Staging in Drupal 8
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
DCI with groovy
DCI with groovyDCI with groovy
DCI with groovy
 
Core Java- An advanced review of features
Core Java- An advanced review of featuresCore Java- An advanced review of features
Core Java- An advanced review of features
 

Plus de Geeks Anonymes

Programmer sous Unreal Engine
Programmer sous Unreal EngineProgrammer sous Unreal Engine
Programmer sous Unreal EngineGeeks Anonymes
 
Implémentation efficace et durable de processus métiers complexes
Implémentation efficace et durable de processus métiers complexesImplémentation efficace et durable de processus métiers complexes
Implémentation efficace et durable de processus métiers complexesGeeks Anonymes
 
Managing Open Source Licenses (Geeks Anonymes)
Managing Open Source Licenses (Geeks Anonymes)Managing Open Source Licenses (Geeks Anonymes)
Managing Open Source Licenses (Geeks Anonymes)Geeks Anonymes
 
Reprendre le contrôle de ses données
Reprendre le contrôle de ses donnéesReprendre le contrôle de ses données
Reprendre le contrôle de ses donnéesGeeks Anonymes
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes
 
Le rôle du testeur et le Blackbox testing
Le rôle du testeur et le Blackbox testingLe rôle du testeur et le Blackbox testing
Le rôle du testeur et le Blackbox testingGeeks Anonymes
 
Vulnérabilités au cœur des applications Web, menaces et contre-mesures
 Vulnérabilités au cœur des applications Web, menaces et contre-mesures Vulnérabilités au cœur des applications Web, menaces et contre-mesures
Vulnérabilités au cœur des applications Web, menaces et contre-mesuresGeeks Anonymes
 
191121 philippe teuwen cryptographie et attaques materielles
191121 philippe teuwen cryptographie et attaques materielles191121 philippe teuwen cryptographie et attaques materielles
191121 philippe teuwen cryptographie et attaques materiellesGeeks Anonymes
 
"Surfez couverts !" - Conseils de Cyber securité
"Surfez couverts !" - Conseils de Cyber securité "Surfez couverts !" - Conseils de Cyber securité
"Surfez couverts !" - Conseils de Cyber securité Geeks Anonymes
 
Introduction au développement mobile - développer une application iOS et Andr...
Introduction au développement mobile - développer une application iOS et Andr...Introduction au développement mobile - développer une application iOS et Andr...
Introduction au développement mobile - développer une application iOS et Andr...Geeks Anonymes
 
Intelligence artificielle et propriété intellectuelle
Intelligence artificielle et propriété intellectuelleIntelligence artificielle et propriété intellectuelle
Intelligence artificielle et propriété intellectuelleGeeks Anonymes
 
Pour une histoire plophonique du jeu video
Pour une histoire plophonique du jeu videoPour une histoire plophonique du jeu video
Pour une histoire plophonique du jeu videoGeeks Anonymes
 
Become Rick and famous, thanks to Open Source
Become Rick and famous, thanks to Open SourceBecome Rick and famous, thanks to Open Source
Become Rick and famous, thanks to Open SourceGeeks Anonymes
 
Reconnaissance vocale et création artistique
Reconnaissance vocale et création artistiqueReconnaissance vocale et création artistique
Reconnaissance vocale et création artistiqueGeeks Anonymes
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingGeeks Anonymes
 
Sécurité, GDPR : vos données ont de la valeur
Sécurité, GDPR : vos données ont de la valeur Sécurité, GDPR : vos données ont de la valeur
Sécurité, GDPR : vos données ont de la valeur Geeks Anonymes
 

Plus de Geeks Anonymes (20)

Programmer sous Unreal Engine
Programmer sous Unreal EngineProgrammer sous Unreal Engine
Programmer sous Unreal Engine
 
Implémentation efficace et durable de processus métiers complexes
Implémentation efficace et durable de processus métiers complexesImplémentation efficace et durable de processus métiers complexes
Implémentation efficace et durable de processus métiers complexes
 
Managing Open Source Licenses (Geeks Anonymes)
Managing Open Source Licenses (Geeks Anonymes)Managing Open Source Licenses (Geeks Anonymes)
Managing Open Source Licenses (Geeks Anonymes)
 
Reprendre le contrôle de ses données
Reprendre le contrôle de ses donnéesReprendre le contrôle de ses données
Reprendre le contrôle de ses données
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
Le rôle du testeur et le Blackbox testing
Le rôle du testeur et le Blackbox testingLe rôle du testeur et le Blackbox testing
Le rôle du testeur et le Blackbox testing
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Vulnérabilités au cœur des applications Web, menaces et contre-mesures
 Vulnérabilités au cœur des applications Web, menaces et contre-mesures Vulnérabilités au cœur des applications Web, menaces et contre-mesures
Vulnérabilités au cœur des applications Web, menaces et contre-mesures
 
191121 philippe teuwen cryptographie et attaques materielles
191121 philippe teuwen cryptographie et attaques materielles191121 philippe teuwen cryptographie et attaques materielles
191121 philippe teuwen cryptographie et attaques materielles
 
"Surfez couverts !" - Conseils de Cyber securité
"Surfez couverts !" - Conseils de Cyber securité "Surfez couverts !" - Conseils de Cyber securité
"Surfez couverts !" - Conseils de Cyber securité
 
Introduction au développement mobile - développer une application iOS et Andr...
Introduction au développement mobile - développer une application iOS et Andr...Introduction au développement mobile - développer une application iOS et Andr...
Introduction au développement mobile - développer une application iOS et Andr...
 
Le langage rust
Le langage rustLe langage rust
Le langage rust
 
Test your code
Test your codeTest your code
Test your code
 
Intelligence artificielle et propriété intellectuelle
Intelligence artificielle et propriété intellectuelleIntelligence artificielle et propriété intellectuelle
Intelligence artificielle et propriété intellectuelle
 
Pour une histoire plophonique du jeu video
Pour une histoire plophonique du jeu videoPour une histoire plophonique du jeu video
Pour une histoire plophonique du jeu video
 
Become Rick and famous, thanks to Open Source
Become Rick and famous, thanks to Open SourceBecome Rick and famous, thanks to Open Source
Become Rick and famous, thanks to Open Source
 
Reconnaissance vocale et création artistique
Reconnaissance vocale et création artistiqueReconnaissance vocale et création artistique
Reconnaissance vocale et création artistique
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Sécurité, GDPR : vos données ont de la valeur
Sécurité, GDPR : vos données ont de la valeur Sécurité, GDPR : vos données ont de la valeur
Sécurité, GDPR : vos données ont de la valeur
 
Modern sql
Modern sqlModern sql
Modern sql
 

Dernier

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Dernier (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Mieux programmer grâce aux design patterns