Some parts of the application require other parts, and may be as yet undefined. We need to test the existing part without writing the whole application.


Define a wrapper class to handle a message that has yet to come.

Related Patterns


The Future pattern is very useful for asynchronous operations, as well as during active development.


We could implement a database connection as a Future. That means we can use the shell interface until we are able to set up the database and connect that properly.


Here, the implementation of Future can be changed in the future to reflect other parts of the system.

class Future{
  int toBeImplemented;
  Future(int f){toBeImplemented = f;}
  int getval(){return toBeImplemented;}
int main(){
  Future f = new Future(3);