Question: Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It

 Question 1: Observer and Command Patterns [50 marks (a) Create a

Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It should be possible to o Find the current length of the sequence Retrieve any sub-range of the sequence as an array of integers Remove and sub-range of integers from the sequence . Insert an array of integers at any point in the sequence . Add an observer (see the Observer pattern) . Remove an observer (see the Observer pattern) (b) Create an implementation of the IntSequence interface that is observable. (This does c) Create a set of JUnit tests that demonstrate that your class from (b) functions correctly (d) Use the Command pattern to make a class that implements the IntSequence interface not need to be an efficient implementation.) 14 marks] 8 marks but also supports undoing and redoing actions. You should resulse the class from part (b). [14 marks] (e) Create a set of JUnit tests that demonstrate that your class from (d) functions correctly You can reuse the tests from (c), but will also need additional tests to test undo/redo 7 marks Question 1: Observer and Command Patterns [50 marks (a) Create a Java interface for a mutable (changeable) sequence of integers called IntSequence 7 marks It should be possible to o Find the current length of the sequence Retrieve any sub-range of the sequence as an array of integers Remove and sub-range of integers from the sequence . Insert an array of integers at any point in the sequence . Add an observer (see the Observer pattern) . Remove an observer (see the Observer pattern) (b) Create an implementation of the IntSequence interface that is observable. (This does c) Create a set of JUnit tests that demonstrate that your class from (b) functions correctly (d) Use the Command pattern to make a class that implements the IntSequence interface not need to be an efficient implementation.) 14 marks] 8 marks but also supports undoing and redoing actions. You should resulse the class from part (b). [14 marks] (e) Create a set of JUnit tests that demonstrate that your class from (d) functions correctly You can reuse the tests from (c), but will also need additional tests to test undo/redo 7 marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!