package com.learning.facade;// 主菜子系统
public class MainFood implements MealSubsystem {@Override public void order() { System.out.println("点主餐");} @Override public void prepare() { System.out.println("准备主餐");} @Override public void serve() { System.out.println("端上主餐");}
}
3.甜品子系统接口
package com.learning.facade;// 甜品子系统
public class Dessert implements MealSubsystem {@Override public void order() { System.out.println("点甜品");} @Override public void prepare() { System.out.println("准备甜品");} @Override public void serve() { System.out.println("端上甜品");}
}
4.汤子系统接口
package com.learning.facade;// 汤品子系统
public class Soup implements MealSubsystem {@Override public void order() { System.out.println("点汤");} @Override public void prepare() { System.out.println("准备汤");} @Override public void serve() { System.out.println("端上汤");}
}
4.外观类服务员
package com.learning.facade;/*** 外观类 - 服务员*/
public class Waiter {private MealSubsystem mainFood;private MealSubsystem soup; private MealSubsystem dessert; public Waiter() { this.mainFood = new MainFood();this.soup = new Soup(); this.dessert = new Dessert(); } public void orderMeal() { mainFood.order();soup.order(); dessert.order(); // 假设准备和送餐是同时进行的 prepareAndServe(); } private void prepareAndServe() { mainFood.prepare();soup.prepare(); dessert.prepare(); mainFood.serve();soup.serve(); dessert.serve(); }
}
4.客户端
package com.learning.facade;// 客户端
public class Client { public static void main(String[] args) { Waiter waiter = new Waiter();// 顾客告诉服务员点餐,服务员负责处理整个点餐、准备和送餐流程waiter.orderMeal();}
}
MambaOut: Do We Really Need Mamba for Vision? 在视觉任务上我们需要Mamba吗?
论文地址 代码地址
知乎解读:王牌飞行员申请出战! 知乎解读:Mamba 模型解读 (一):MambaOut:在视觉任务中,我们真的需要 …