/******************************************************************************************************************* * * {@inheritDoc} * * This method demonstrates the typical idiom for populating data: * * 1. A dao is called to provide raw data - let's say in form of collections; * 2. Objects in the collection are transformed into PresentationModels. * 3. The PresentationModels are then passed to the presentation. * ******************************************************************************************************************/ @Override public void start() { presentation.showUp(); final Collection<SimpleEntity> entities1 = dao.getSimpleEntities(); final Collection<SimpleDciEntity> entities2 = dao.getDciEntities(); final PresentationModel pm1 = entities1.stream().map(e -> pmFor(e)).collect(toCompositePresentationModel()); final PresentationModel pm2 = entities2.stream().map(e -> pmFor(e)).collect(toCompositePresentationModel()); presentation.populate(pm1, pm2); }