Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago