How to design and build composite applications