finalset Flashcards
What is a service, in like service oriented architecture
https://refactoring.guru/design-patterns/behavioral-patterns
– > bro just read this site lol
loosely coupled, reusable software describes some discrete func
web service
distributed, access by code
What are the Service Oriented Design Principles
Well defined Interface (describe the service well for custs)
Loose Coupling (i don’t know how stripe works, idc)
Separation of Concerns
Reusable
Coarse Grained
Sherlock appears with a BIG SMILE as a waiter
but john and mary are miffed and turned away from each other at the table
Sherlock says ‘it’s me’ john says ‘i don’t care… sherlock’
Sherlock’s mustache falls into the champagne, he puts it back on
‘FUCK YOU SHERLOCK’ says john, who turns out to be anakin skywalker, blasting his face with sand
What is Observer Design Pattern
exchange_websockets
What is the Command Pattern
Like
Create Order instance order = Order()
Create Stock instance stock = Stock()
Create Buy instance orderType = Buy()
then command all the sequences, together, q dumb
What is the Prototype Pattern
if there’s already an existing object like this:
Car carA = new Car();
carA.brand = ‘bugatti’;
// brand and color are not in the constructor, tough stuff
and we wanna copy the object, we’d have to do
Car carB = newCar();
carB.brand = carA.brand;
// so tiresome… ugh. imagine having to do many of these
prototype will say, okay there’s a prototype class now,
and that’ll make sure that all the attrs are copied over
also, prototype class is everyone’s zaddy, so you’re all prototypes :)
What is the Factory Pattern
imagine the whole cooking crew right in the middle of the restaurant right there combining this set of ingredient and that set of ingredient (messy conditionals) right in the open and the customers grossed out watching this
now, we have a new object (factory/kitchen), we put them there, with their conditionals.
and then when someone needs a burger you put a nice getBurger() slip inside the kitchen window, and out pops a burger
What are the mid level design patterns
broker
facade
mediator (airplanes, runway)
adaptor
proxy
generator
factory
singleton
prototype
reactor
command
observer
blackboard
repository
bridge
remote controller to tv