A model for self-assembly in solution