-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API suggestion for symmetric conventions #34
Comments
Hi Mehdi, I agree with you on the fact that I'm not exactly a fan of I have some ideas on how we might improve on that, but sadly haven't been able to dedicate much time to the project over the last few weeks. If you look through history, you'll see that we attempted something similar to what you're proposing, however I strongly feel separate Specifically, in what they do symmetric conventions are hardly different from non-symmetric ones and they don't deserve being an explicit, parallel universe. Also I imagine a scenario where users might want to use the same convention symmetrically and not. For example I might want all my Views to live in a given namespace, but I don't care what else lives there. I think we should concentrate on making them stand out less, not more, and being natural, no brainer to use. |
My idea behind As @kkozmic said, my first attempt at symmetric conventions went down the road of a separate interface and overloads specific to symmetric conventions. This felt like a lot of work to maintain in the long run. TBH i think we need to create 3 or 4 symmetric conventions then try to simplify all of them by adapting the CT api. So, what other symmetric conventions could we put in the box to try? |
I am writing a symmetric convention for Shouldly, we have This is what it ended up looking like. https://github.com/shouldly/shouldly/pull/252/files#diff-eb10efae6035000b7610595c5b728ddeR23 Thoughts? |
As much as I love the power symmetric conventions provide I think their difference makes them confusing. For example I love
ClassTypeHasSpecificNamespace
but it's the only convention that takes a type filtering predicate.I think it would be more consistent if we removed
classType
andclassIsApplicable
from constructor. We could have aSymmerticConvention
class much like theConvention
class with anIs
method and also anISymmetricConvention
forConvention
where theExecute
method accepts a preciate in addition to those required byExecute
inIConvention
.SymmetricConvention
could then accept a predicate required for symmetric logic which is passed into theExecute
method.Thoughts?
The text was updated successfully, but these errors were encountered: