Hallo! Ich habe folgende Aufgabe, aber kenne mich damit nicht so gut aus. Ich muss den Decorator Pattern verwenden und zwei Klassen schreiben (MorseReader und ROT13Writer). Kann mir da jemand helfen, wie ich anfangen könnte?
Aufgabenstellung:
Scan the class-javadocs of java.io classes. Which ones are suitable for your needs? Can you spot other implementations of the decorator pattern in this package?
Write two decorator classes: One that decorates an existing Java class for (i) reading and one for (ii) writing character streams.
Use the following class names:
(i) MorseReader
(ii) ROT13Writer
Make sure that each one of your two decorator classes decorates an existing Java class from the java.io package. Which class should you decorate, such that you really benefit from the pattern?
Note: the assignment is about CHARACTER streams (see above).
The reading decorator shall implement a morse code translator [3,4]. For example, a file containing .... . .-.. .-.. --- will be read as hello.
The writing decorator shall implement the ROT13 cipher algorithm.
Aufgabenstellung:
Scan the class-javadocs of java.io classes. Which ones are suitable for your needs? Can you spot other implementations of the decorator pattern in this package?
Write two decorator classes: One that decorates an existing Java class for (i) reading and one for (ii) writing character streams.
Use the following class names:
(i) MorseReader
(ii) ROT13Writer
Make sure that each one of your two decorator classes decorates an existing Java class from the java.io package. Which class should you decorate, such that you really benefit from the pattern?
Note: the assignment is about CHARACTER streams (see above).
The reading decorator shall implement a morse code translator [3,4]. For example, a file containing .... . .-.. .-.. --- will be read as hello.
The writing decorator shall implement the ROT13 cipher algorithm.