一、子系统
package com.study.facade_pattern
class LoginFunction {
fun function() {
println("登录功能")
}
}
package com.study.facade_pattern
class MarketFunction {
fun function() {
println("市场功能")
}
}
package com.study.facade_pattern
class PayFunction {
fun function() {
println("支付功能")
}
}
二、门面类
package com.study.facade_pattern
class TianMaoApp {
fun function() {
var login = LoginFunction()
login.function()
var market = MarketFunction()
market.function()
var pay = PayFunction()
pay.function()
}
}
三、主程序调用
package com.study.facade_pattern
fun main() {
var tianMaoApp = TianMaoApp()
tianMaoApp.function()
}