Sunday, September 29, 2013

Usinge a Singleton Class to expose an interface

Usinge a Singleton Class to expose an interface

I am currently doing an assignment to create a WebCrawler, and one of the
requirements is
"Your application must implement a singleton class, DownloadRepository. An
instance of this class must be suitably initialized at system startup
using an appropriate static initializer. This singleton must expose an
interface that can be used by the crawler class (WebPage) to save a
WebElement object to the repository. "
I understand how to implement a singleton class. But my question is what
does "expose an interface" exactly mean?(I know that is more a question
for my professor but i cant reach him) Does the singleton somehow create a
a global interface that can be used with other classes? If this is
possible how would it be done?

No comments:

Post a Comment