I am working on a software assignment where the design is component based. The components have ports which provide interfaces.
My professor argues that the Port class which is exposed by each component should be a Singleton, as the port must be the only way to interact with the component. As I see it, multiple instances don't interfere with the requirement that the port must be the single interaction point.
Is as singleton the right way to implement a Port to the component?
To give an example:
The assignment is a model of an airplane and an airport. The components are different parts of an airplane and the airport. As it is a group assignment, different students have to implement different components.
This is the UML diagram of the different components of the airport:
The interfaces are implemented in a class named Port, which is an inner class to the actual implementation. The outer class has a public field port and is a singleton. The different components interact by loading the Jar-File and accessing the Port instance via reflection.