java 门面模式

classA{
publicA(intx){
}
}

classB{
publicB(longx){
}
}

classC{
publicC(doublex){
}
}

publicclassFacade{
staticAmakeA(intx){
returnnewA(x);
}

staticBmakeB(longx){
returnnewB(x);
}

staticCmakeC(doublex){
returnnewC(x);
}

publicstaticvoidmain(Stringargs[]){
//Theclientprogrammergetstheobjectsbycallingthestaticmethods:
Aa=Facade.makeA(1);
Bb=Facade.makeB(1);
Cc=Facade.makeC(1.0);
}
}

你可能感兴趣的:(java,C++,c,C#)