KyleSchoonover commented on pull request #1569: URL: https://github.com/apache/avro/pull/1569#issuecomment-1052621437
@martin-g I've been following Extreme Programming for so long that it is rare that I implement code for potential changes (unless it's iterative development where I am deploying pieces of functionality dark). I understand that factory pattern when it comes to NamedSchema, However, UnnamedSchema, while it follows a similar implementation there was nothing in the base class enforcing the use of a factory pattern, which is why this was throwing me off. I'm a bit indifferent about changing it, but NewInstance's accessor is internal (this doesn't exist in Java to my knowledge), which means only the Avro.Main library can create an instance. As far as I can tell moving this to an internal constructor the only place that would need changes are in the Schema.Parse method. So the only way for a user of this library is to call Schema.Parse to create an ArraySchema. On the other hand, We could make UnnamedSchema follow the factory pattern to enforce it on those that inherit it. That would be a breaking change though. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
