How do I design a class so that methods must be called in a certain order?--Raymond Chen

Simple but effective.

How do I design a class so that methods must be called in a certain order?

by Raymond Chen

From the article:

Suppose you have a class with some methods, and the methods must be called in a certain order. For example, suppose your class is for importing photos from a camera. First, you have to specify which camera you are importing from. Then you discover the pictures. Then you have to select which pictures you want to import, and set the options for how you want the download to occur. And finally, you download them...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.