Other than being a great library for throwing exceptions, this video is also a great showcase for how to implement the Guided Builder pattern. Notice how each method call in the fluent API has only the allowed methods that can be chained. And how you can go back to the top of the chain by calling the base method (Throw) again. Great video :)
@amantinband2 жыл бұрын
Thanks man 🫶🏼
@marekjaskua67742 жыл бұрын
Package looks impresive. However, it would be nice if you add more support for custom exceptions. For instance a possibility to write user.ThrowIfNull("Unauthorized user"); Instead of user.ThrowIfNull(() => throw new ForbidException("Unauthorized user")); Writing my own such extension method each time would a bit of a pain.
@damianjoel58333 ай бұрын
Agree, or something like that: UserName = userName.Throw().NotNull().NotEmpty().MaxLength(90);
@geraldmaale Жыл бұрын
I have actually learned a lot from your presentations. I integrated the ErrorOr package in my applications, and its wonderful. I even customized it with OpenTelemetry to add logs with codes as you demonstrated in your video. Thanks for works. 👍👍👍
@zhh1742 жыл бұрын
I really loved your package ErrorOr so much.
@jvetter713 Жыл бұрын
This is fantastic! Can't wait to give it a try.
@propro8040 Жыл бұрын
thank you. this is sooo cool. You are going to be the next Nick Chapsas
@OrgesKreka Жыл бұрын
Great library and great explenation. Thank you. Please could you do a video on standart way to document a class/method.
@hamedsalameh81552 жыл бұрын
Thanks for sharing this !! I'm gonna give this one a try !
@gui.ferreira2 жыл бұрын
Excellent video Amichai! Now I have to play with it. Already looking for an oportunity 😄
@amantinband2 жыл бұрын
Thanks, waiting to hear what you think! 🫶
@birukayalew38622 жыл бұрын
Dear Amichai, you have written a wonderful library and the presentation is excellent. keep going. The BuberDinner series project is complete or not. I am following you please finish it quickly.
@amantinband2 жыл бұрын
Thanks, Biruk! Buber Dinner is not finished. There is a lot of DDD content still to come, don't worry!
@carloswinstonjavierllenas3117 Жыл бұрын
Hmmm, interesting and very readable. What I'm not seeing is what is the difference, for example in BuberDiner, with the HandlerValidators. Or are these used in other sections of that project? Basically I can't get if this complements the HandlerValidators or is another option entirely. Maybe I'm too stubborn with the old ways. :D
@robbyscherpereel2 жыл бұрын
What about not throwing exceptions in your code. As exceptions are heavy.. Would rather work with FluentResult. Also you could use FluentValidation, which would make the config centralized. Thoughts?
@amantinband2 жыл бұрын
Definitely the approach I prefer. If you like that approach, you might like my ErrorOr package: github.com/amantinband/error-or
@neutronstar4822 жыл бұрын
Very usefull. Im going to replace some code in one project.
@kgnet88312 жыл бұрын
Great library 👍 but devils advocat, why not just use Fluentvalidation, why should I use Throw instead of? I see the appeal of this library, but it would be nice to have a comparison to FluentValidation and when to use which... either way after ErrorOr the second of your libraries I will put in my code, so thank you 👏
@amantinband2 жыл бұрын
Thanks, Kai. FluentValidation is for model validation, whereas Throw is primarily for guard clauses
@bobek80302 жыл бұрын
@@amantinband What if I dont want to throw exceptions, can I somehow use FluentResults with this package?
@ezecel92 жыл бұрын
Great video, thanks
@a-s733 Жыл бұрын
amazing
@manaralkammessy63602 жыл бұрын
Thanks Amichai for another fantastic tutorial. quick question how do we optimally use throw package with error/exeception hnadling middleware. do we throw our custom exceptions and validate it in the class the exception is thrown or is validation performed in the exception handling controller?
@amantinband2 жыл бұрын
Ironically, I'm not a fan of throwing exceptions for flow control. Have you watched my video on flow control? I cover various approaches as well as what I would recommend: kzbin.info/www/bejne/qoubmHqnntaSf7c
@mugilkarthikeyan71312 жыл бұрын
The way I uses is that the model validation is done with ErrorOr and the data validation is done with Throw.
@DerClaudius2 жыл бұрын
Bigger font would be nice.. so it's easier to view on mobiles
@guuggle81162 жыл бұрын
Which extension are you using to make vscode auto adding using statements when you use a type from say another referenced project? I've downloaded c# auto using extension but it seems to not be working when the type is from my own code base from another project.
@tussle2k Жыл бұрын
I think it comes from GitHub copilot but I'm not 100% sure about that
@behype6527 Жыл бұрын
Hi Amichai and thanks for the content, i'm a Senior Java Engineer but you post high quality stuff that does crossover. By any chance, can you hint me towards a similar Java library?
@efimov902 жыл бұрын
15:08 So Validatable is a monad?
@amantinband2 жыл бұрын
It's more of a wrapper around the value with some extra details. Are you asking with regards to the ExceptionCustomizations discriminated union?
@efimov902 жыл бұрын
@@amantinband but, isn't monad pattern about wrapping and adding some logick in processing? Oh... I see discriminated union one time, not so familiar with it. I'm about monad itself, i see several artiles that describes it like a way to use some logick behind scenes like logging while calcilating numbers (used like example in article). So i think this type and logick binded to it can be way to implement a monad and so as i see you more qualified in this topic than me i just try to ask about it.
@JinnGuild Жыл бұрын
@Sergey Efimov That is not what a Monad is. However, a "Maybe Monad" is a Monad that also has details. Since a lot of OO Developers have only touched on the "Maybe Monad", they mistake the pattern for a "Monad". It does look a lot like a "Result Type", but is semantically different. A Monad (in C#) is essentially just an IEnumerable that represents a Scalar (single value), and the collection either has ONE value of type T, or ZERO values of type T. Therefore, it is "Monadic" aka: It has One (or zero) values. Even though technically an IEnumerable (or some collection) could have millions. One value means the work was completed successfully and returned something. Zero values means there was some issue. This saves you from having to return `null` or `throw` an exception to represent that something went wrong. The "Maybe" Monad is the same as a Monad, but it also includes additional details about why ZERO items were returned. Exception info or just message or whatever. But this should not be used as or confused for a SOAP-style "Result" type. TLDR; The point of following Monadic methods is to NOT throw exceptions or return null. The whole point of this video is to purposely throw exceptions. Check out my related video: kzbin.info/www/bejne/jHTCpXShj85kiJY
@semenkovalev4988 Жыл бұрын
This is very nice lib for code writing/reading. But it looks like a performance killer and a possible memory eater. It creates structures in memory BEFORE using them. And in most cases it will be dummies.
@benjamininkorea7016 Жыл бұрын
Bro, why do I have the overwhelming desire to ask for your advice about women? :D Just joking, ty for the great video. Subbed and keep it up
@urbanelemental33082 жыл бұрын
Applause!
@iliyan-kulishev2 жыл бұрын
Oh no I have refactored my whole project to use ErrorOr what is this now? :D
@amantinband2 жыл бұрын
🤣
@eatsleepcode532 жыл бұрын
does microsoft use it ?
@allanhouston225 ай бұрын
It sucks. We shouldnt be throwing exceptions on validation
@stevekeith9507 Жыл бұрын
This is awasome library, after watching all the features. I like OnlyInDebug()!