Comments (5)
Hey @cottsak. Thanks for the comment.
The implicit operator is a bit controversial and Rob and I debated it a lot when I implemented it. There's a trade off between the convenience you mention and the desire to be quite explicit. I think it's clearly documented, which hopefully achieves the right balance.
Basically, if you use var to define your variable you have to call Build, otherwise how does the compiler know what to create? And, if you want to use the implicit creation you have to explicitly declare the variable.
But, given this particular scenario, I'm not quite sure how using the same antUser twice is working. If you are declaring it twice then I would expect two different instances with different Id values, but if you are declaring one variable and using it twice you'd obviously expect the same values... Do you have an example of the whole test?
from teststack.dossier.
I can see how that would cause a problem, but I'm happy enough that it's discoverable when you realise that antUser
is of type UserBuilder
rather than User
.
All of the code samples include an explciit .Build()
call, it's only when you view http://dossier.teststack.net/docs/creating-entities-implicitly that we introduce the implicit operator as a thing.
I'm happy enough with that.
from teststack.dossier.
I find the implicit operator misleading. It's there and so folks will use it. The presence of the operator "reveals" a contract to the user (aided by productivity tools like R#, etc that go and find these things more proactively) whether the examples always use Build()
or not.
Speaking to "documentation" @mwhelan, as I highlighted in this other issue, folks aren't going to go and read doco in the first instance and they may not even resort to the doco if something doesn't behave the way they expect. UX (which applies as much to a package/lib as much as a UI form) is predicated on conventions (among other things). Those conventions are expectations that users have in advance and implicitly apply to your interface. In this case, the explicit requirement to Build()
every time would have been easier to understand and use as opposed to discovering an implicit operator and then it causing me more pain because it doesn't do what I expected.
In terms of ROI, how did you guys justify adding the implicit operator in your "debating" @robdmoore @mwhelan?
I like these tools and I want to promote them wherever I go provided it fits with my philosophy and I can advertise to other devs how easy they are. If I can understand your thinking then perhaps I can be more forgiving to these kinds of peculiarities.
from teststack.dossier.
I personally don't use the implicit operator at all because I prefer the explicit .Build call and I also like var
:P
One thing I will say though is that you should keep in mind that you are only but a single user Matt, other people's expectations may not match yours. I don't want to discount your opinion though since it's also possible that the majority of user's match your opinion.
I'd prefer if you tone down your language though mate - this is an OSS library, not something we get paid for so calling decisions that have been made "smelly" and "peculiarities" rather than giving benefit of the doubt is a little "unsettling" to use your phrase from the other thread...
If we have a few different users that also feel the implicit operator is confusing I don't object to taking it out, but I'd like to see a reasonable discussion about both sides and if we did it we'd obviously have to bump the major version since it's a breaking change.
from teststack.dossier.
@robdmoore I'm a passionate guy as you know Rob and because I love this tool I can get direct when it fails to keep me perfectly satisfied. I also have a very narrow view of the world when it comes to writing great software and possibly because I know you a little Rob, I hold you (and by extension this package) to a higher standard than others. Perhaps I've done the wrong thing.
But you're right, I am only one user. Thanks for engaging me.
from teststack.dossier.
Related Issues (20)
- ListBuilder proxy objects don't override "Set" method HOT 9
- Provide some kind of "Retrieve" or "Sample" method, which returns one of the objects *already* built by a builder HOT 4
- Ability to specify a Seed value for all random generation HOT 2
- Setting defaults in constructor when creating lists causes exception HOT 1
- Overriding defaults set in constructor HOT 3
- new() constraint on TestDataBuilder<,> HOT 5
- "Doesn't not matter" - typo on wiki page HOT 1
- Add ITestDataBuilder<TObject> interface, missing after migration from NTestDataBuilder HOT 2
- Calling TestDataBuilder.CreateListOfSize() when the builder have a constructor calls the constructor with one extra call HOT 12
- Can I turn off the anonymous values generation for a builder? HOT 9
- Question about usage scenarios HOT 4
- Create object list based in relation to ohter object list HOT 3
- Use builder in for constructor parameter HOT 6
- Licence question HOT 2
- Pick is missing in nuget TestStack.Dossier 3.2.1 HOT 4
- Building lists of relational database entities HOT 5
- Simple bool Get() is failing to return default(bool) (aka False) HOT 4
- Creating objects with properties of complex types HOT 2
- Looking for example of a builder that builds an object with a collections of child objects HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teststack.dossier.