Factory method pattern

  • 18
  • Locked
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
You can't complete this task, because you're not signed in.
Comments (6)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Jcode
Level 26 , United Kingdom
1 June, 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?
Justin Smith
Level 31 , Greenfield, USA, United States
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).
31 October 2020, 12:24
Yes
Andrey
Level 18 , St. Petersburt, Russian Federation
7 May 2020, 17:06
As I understand better call it Simple Factory
Angelika
Level 25 , Budapest, Hungary
29 October 2019, 19:42
Last 4 conditions didn't pass and I don't know why? Please somebody help me! Thanks!
Roman
Level 41
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.