public interface Person {
public void say();
}
public class Teacher implements Person {
@Override
public void say() {
System.out.println("我是一名教师!");
}
}
public class Student implements Person {
@Override
public void say() {
System.out.println("我是一名学生!");
}
}
/resources/META-INF/services/com.zsxq.zsxq.javaspi.Person
com.zsxq.zsxq.javaspi.Teacher
com.zsxq.zsxq.javaspi.Student
实现案例:
DriverManager.getConnection(url, user, password);
dubbo
public void say();
}
public class Teacher implements Person {
@Override
public void say() {
System.out.println("我是一名教师!");
}
}
public class Student implements Person {
@Override
public void say() {
System.out.println("我是一名学生!");
}
}
/resources/META-INF/services/com.zsxq.zsxq.javaspi.Person
com.zsxq.zsxq.javaspi.Teacher
com.zsxq.zsxq.javaspi.Student
实现案例:
DriverManager.getConnection(url, user, password);
dubbo