CS3SAD/CSMDAS: Software Architecture and Design Week 4: Architectural styles Exercise sheet 3: Answers I am going to give minimal answers – that is, the solutions that require the least amount of work, but would guarantee full marks. Students who do more work would of course and got full marks and my approval. Also – there was mistake in the wording of the original exercise sheet. Students were told to “Make sure you specify interfaces in detail -- but, to save yourself time and effort, do not use more than 3 methods in an interface.” What was meant was “specify only 3 interfaces in detail”. Students could easily have answered using only 3 methods per interface for questions 2— 5 – but this would be difficult to do for question 1. 1. Design a HTML editing tool. It should include a GUI similar to the kind used by editors like Dreamweaver or Microsoft Frontpage. Actually we will clone the functionality of Mozilla Composer. The editor is to offer four ways to view and edit HTML text: a WYSIWYG view (“Normal”), a WYSIWYG view but with HTML tags made explicit (“HTML Tags”), a view of the raw HTML source (“HTML Source”) and a preview of the HTML as an executable web page in Mozilla (“Preview”). The user should be able to load up and save their HTML files and select between the four views, editing text in one view, switching to another view, and then seamlessly continuing to edit in that view, and so on. Solution: This is the advanced question of the exercise sheet. Here is a sample architecture:

This
preview
has intentionally blurred sections.
Sign up to view the full version.

NormalView TagsView SourceView PreviewView Repository <<publish/subscribe>> ISource INormal ITags IPreview IChange INotify GUI ILoadSave ISource The design solution should utilize the blackboard style. The four editing views are encapsulated by four client components, SourceView , NormalView , TagsView and PreviewView , acting on and receiving information from a blackboard component Repository. For the sake of completeness of the design, we have included a GUI component, GUI, that provides a centralized means of operating on the four views, and performing other required functions of the editor (such as loading and saving files). The purpose of the Repository component is to store HTML data. It has three interfaces: • A provided interface, ILoadSave , exposing functionality related to loading and saving HTML data to and from a file. • A provided interface,

This is the end of the preview.
Sign up
to
access the rest of the document.