1. Take a careful look at the classes you have.
2. In separate files in the common package, create JpgReader, PngReader, and BmpReader classes that implement the ImageReader interface.
3. In a separate file in the main package, create the ImageReaderFactory class with one method.
3.1. Think about wh
Factory method pattern
- 18
Locked
Comments (6)
- Popular
- New
- Old
You must be signed in to leave a comment
Jcode
1 June 2022, 23:18
Quite a few people fail validation because they don't check for null in the ImageType passed to ImageReaderFactory.
My question is ... How can you pass a null when getImageReader(ImageType) will only accept a defined set of values in ImageType enum?
0
Justin Smith
17 September 2021, 15:12
Can't believe I got this on my first try! Really enjoyed this one. It's helpful to occasionally have refresher tasks like this on stuff we've probably forgotten about (like enums).
0
Prof. MOHD ASHFAQUE
31 October 2020, 12:24
Yes
+1
Andrey
7 May 2020, 17:06
As I understand better call it Simple Factory
0
Angelika
29 October 2019, 19:42
Last 4 conditions didn't pass and I don't know why? Please somebody help me! Thanks!
0
Roman
30 October 2019, 08:11
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
0