Closed robert-iddink closed 9 years ago
@philippd what's your take on this? We've been using the class' simple name on purpose because we want to "encourage" people to use unique names for their entities/model classes. One shouldn't have two Person
model classes in two different packages.
@marcelstoer How about two Name
classes in different packages? That's our use case at the moment ;-).
This should work fine. The only thing to keep in mind is to always use the fully qualified class name in the valdr-type directive when this option is enabled.
This should work fine.
Yes, it will work. I'm just not sure whether we should offer that option at all? IIRC we've been discussing this before during the initial implementation. It's irrelevant whether your model class is a Person
or a Name
(even though it's semantically more generic) it's IMO still bad practice.
My point essentially is about how restrictive the project should be in enforcing what we consider good or bad practice.
Yes we discussed it back then and decided to use the simple name to encourage best practices and keep the names in the markup short.
IMO it's fine to add the option as long as the default is to use the simple name. This way we still encourage to use what we consider good practice, but also support cases where someone might not be able to avoid having two classes with the same name (3rd party code).
I could add a comment to make it explicit that the simple name is the suggested usage, would that help?
Netcetera » valdr-bean-validation #100 SUCCESS This pull request looks good (what's this?)