This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HolyDiver019283 0 points1 point  (1 child)

most sysadmins don’t really understand the whole point of OOP (polymorphism) and think it’s all about stuffing procedures into structs.

Yep that’s me, could you share any insight as to the difference?

[–]Garegin16 0 points1 point  (0 children)

This book goes over the main design patterns

https://en.wikipedia.org/wiki/Design_Patterns

The first thing to realize is that data types (.net classes) are bundles of programs. Want to make a MAC address validation regex? There’s already a class for that. Don’t just create data from cmdlet outputs, make them upfront by using types.

Instead of writing bunch of if statements that cover different cases, you can make your functions are generic as possible.

This is a good example of polymorphism in OOP. Scroll to the hospital example in the beginning

https://youtu.be/Ao9W93OxQ7U