The Rules Engine Design Pattern with C#

  Рет қаралды 13,677

Spyros Katsios

Spyros Katsios

Күн бұрын

Пікірлер: 24
@mihaiga
@mihaiga Жыл бұрын
Very concise video, great job. My recommendation would be to encapsulate the ordering inside the rule engine since using an Enum for ordering is not very clean and does not communicate to other developers that there is a dependency between the Enum and the business logic. An improvement for real-world scenarios could be to use the strategy pattern and define a list of ordered rules as a strategy that can be applied. Keep up the good work and I hope to see your channel grow!
@codingwithtien
@codingwithtien Жыл бұрын
I had a live coding interview a few years ago and they asked me to solve precisely this topic. Thanks for your video.
@spyroskatsios
@spyroskatsios Жыл бұрын
You are welcome! Hope you did well in the interview!
@zefur321
@zefur321 9 ай бұрын
can i keep rules in database ?
@spyroskatsios
@spyroskatsios 9 ай бұрын
Hi! I suppose you could, but in what form are you going to store them?
@zefur321
@zefur321 9 ай бұрын
@@spyroskatsios now i try to study Drools. but dont know how to install and integrate with eclipse (java). so i not sure c# also have rule engine that can keep rules in configuration file, xml or database or not?
@manchusandy1
@manchusandy1 Жыл бұрын
I want to copy the code. Do you have github link for this ?
@spyroskatsios
@spyroskatsios Жыл бұрын
I uploaded it: github.com/spyroskatsios/KZbin-RulesEngineDemo
@pidjomabeljunior8488
@pidjomabeljunior8488 11 ай бұрын
thanks @@spyroskatsios
@ChequeWriter
@ChequeWriter Жыл бұрын
Good video.
@spyroskatsios
@spyroskatsios Жыл бұрын
Thanks a lot!
@atarconcet
@atarconcet 11 ай бұрын
Good solution, however, I feel that the DiscountRule enum will break the open-closed principle because you will need to modify the enum every time you add a Rule. I would still vote for the order, even if you can assign IDs with gaps, such as ID=100, ID=200. This could give you the freedom to add up to 99 possible rules in between. However, that option isn't perfect either, as it would force you to anticipate what other rules might be added. Nonetheless, it's a good topic and solution. Thanks.
@spyroskatsios
@spyroskatsios 11 ай бұрын
I like your solution! Thanks for your kind words!
@JyotiGupta-gu5kk
@JyotiGupta-gu5kk 2 ай бұрын
Give git for access the code
@spyroskatsios
@spyroskatsios 28 күн бұрын
Hi! Since i don't have yet a solution for sharing the source code, you can download it from google drive: drive.google.com/file/d/1hZLSkDMGZw5DGfyYlwauR3Ysi9Qqbp1f/view?usp=sharing
@JyotiGupta-gu5kk
@JyotiGupta-gu5kk 28 күн бұрын
Thanc​@@spyroskatsios
@georgekalogeropoulos1813
@georgekalogeropoulos1813 Жыл бұрын
Honestly the second version is way more complex 😆
@spyroskatsios
@spyroskatsios Жыл бұрын
You mean the one with the ordering or the one with the rules engine?
@MiningForPies
@MiningForPies Жыл бұрын
Yes it is, when you only have a couple of rules. When you have 10 or 20 or 50 it’s a lot less so, especially around unit testing.
@spyroskatsios
@spyroskatsios Жыл бұрын
@@MiningForPies Exactly! And that's a trade off with demos around ddd and design patterns. You can't have a complex logic since it's a demo, but they look kind of redundant without it!
@majormartintibor
@majormartintibor 4 ай бұрын
Good video.
@spyroskatsios
@spyroskatsios 4 ай бұрын
Thank you! 😊
Client-Side JWT and Refresh Token Handling
16:44
Spyros Katsios
Рет қаралды 1,9 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
How to Add Interaction in Godot 4
16:48
Nagi
Рет қаралды 31 М.
Master This Skill To Become a Better Software Engineer
17:20
Milan Jovanović
Рет қаралды 22 М.
The New Option and Result Types of C#
15:05
Nick Chapsas
Рет қаралды 85 М.
Microservices and Rules Engines - a blast from the past - Udi Dahan
52:48
7 Design Patterns EVERY Developer Should Know
23:09
ForrestKnight
Рет қаралды 232 М.
What are Business Rules? It's not this.
10:58
CodeOpinion
Рет қаралды 31 М.
The Smart Way of Using the Decorator Pattern in C#
12:37
Nick Chapsas
Рет қаралды 72 М.
Master the Fluent Builder Design Pattern in C#
15:05
Milan Jovanović
Рет қаралды 30 М.
Jeremy Ary: (Rule engine) BRAINSSSS! Rete Algorithm Rundown
11:11
Jason Orendorff
Рет қаралды 12 М.
Rule Engine in Java using Generics | Tech Primers
20:15
Tech Primers
Рет қаралды 40 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН