method cohesion when methods need to be called in order
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Consider a class that encapsulates the process of sending an e-mail. setContent() //sets the content send() //sends the message
Calling setContents() after calling send() while a valid call, has no effect. In other words setContents() has meaning only if it is called before a send() call. How does one represent an order in calling methods in cases where the process that detrmines the order is less obvious than the act of sending an e-mail.