If you want you System only have one Object .
On this Ocassion ,we can use the Single Pattern .
The main Format are as follows (in JAVA )
public class BS { //Because our teacher use the BookSystem as an Example.
private static bs= new BS()
private BS(){
//You can write code at this
}
public static BS getBS(){
return bs;
}
}
I have see this Design pattern before,but today I answer the teacher'question,I said that the Factory Pattern can solve the problem that one class in the System that only Create one instance.I make a mistake.It's a very excellent Design Pattern.