using observer-pattern, create a modal dialog component.