Afinal, o que são design patterns? Aprenda em menos de 3 minutos! #tutorial  #designpatterns
Redlint
[{'start': '0.033', 'end': '4.000', 'text': 'Design patterns are specific ways of writing your code'}, {'start': '4.000', 'end': '7.783', 'text': 'in order to solve and deal with specific and usually well-documented problems.'}, {'start': '8.116', 'end': '10.366', 'text': 'This is not a piece of code that you'}, {'start': '10.366', 'end': '13.200', 'text': 'you can simply copy and paste to solve the problems.'}, {'start': '13.366', 'end': '15.166', 'text': 'They only define how the functions,'}, {'start': '15.400', 'end': '18.083', 'text': 'methods and properties must be implemented and'}, {'start': '18.083', 'end': '20.433', 'text': 'used in order to get around certain problems.'}, {'start': '20.566', 'end': '23.566', 'text': 'But the exact implementation is entirely up to the programmer.'}, {'start': '23.683', 'end': '26.000', 'text': 'There are several types of design patterns'}, {'start': '26.000', 'end': '28.300', 'text': 'grouped into several different categories.'}, {'start': '28.566', 'end': '32.533', 'text': 'These categories are creative, structural and behavioral.'}, {'start': '32.716', 'end': '35.400', 'text': "I won't dwell on what each one means in this video,"}, {'start': '35.433', 'end': '39.100', 'text': 'I could dedicate a video to each different type of design pattern.'}, {'start': '39.166', 'end': '40.633', 'text': 'If you are interested,'}, {'start': '40.833', 'end': '42.366', 'text': 'leave a suggestion in the comments,'}, {'start': '42.483', 'end': '45.400', 'text': 'but if you want a good source to learn all of them,'}, {'start': '45.566', 'end': '48.000', 'text': 'the website "refactoring.guru" is perfect for this.'}, {'start': '48.366', 'end': '48.883', 'text': 'Even so,'}, {'start': '49.000', 'end': '51.766', 'text': 'I will give two examples of famous design patterns.'}, {'start': '51.883', 'end': '54.400', 'text': 'The first is the builder and the second is the singleton (wrong cut).'}, {'start': '54.516', 'end': '57.566', 'text': 'See the example on the screen You will encounter them quite often.'}, {'start': '57.683', 'end': '58.966', 'text': 'The Builder design pattern consists of'}, {'start': '58.966', 'end': '64.116', 'text': 'in the chaining of methods of a class to build a complex object little by little.'}, {'start': '64.116', 'end': '66.566', 'text': 'Each method makes only one change to the class.'}, {'start': '66.766', 'end': '67.150', 'text': 'No end,'}, {'start': '67.283', 'end': '69.600', 'text': 'there may be a finalizer method that closes'}, {'start': '69.600', 'end': '71.633', 'text': 'the chain and executes the constructed operation.'}, {'start': '71.766', 'end': '73.600', 'text': 'You can find it in JavaScript,'}, {'start': '73.683', 'end': '76.200', 'text': 'in libraries like JQuery and Express Validator.'}, {'start': '76.316', 'end': '77.433', 'text': 'See a code example (dry cut)'}, {'start': '77.433', 'end': '79.000', 'text': 'The Singleton, on the other hand,'}, {'start': '79.116', 'end': '81.816', 'text': 'is a design pattern used to prevent a'}, {'start': '81.816', 'end': '84.000', 'text': 'class has more than one active instance at the same time,'}, {'start': '84.000', 'end': '86.283', 'text': 'especially when it deals with sensitive data,'}, {'start': '86.316', 'end': '86.883', 'text': 'like money.'}, {'start': '87.000', 'end': '88.683', 'text': 'It is essentially useful in'}, {'start': '88.683', 'end': '91.316', 'text': 'multi-threading and multiprocessing programming,'}, {'start': '91.366', 'end': '93.516', 'text': 'as it helps prevent race conditions,'}, {'start': '93.600', 'end': '93.933', 'text': 'for example,'}, {'start': '94.033', 'end': '95.233', 'text': 'alongside other concepts,'}, {'start': '95.366', 'end': '99.366', 'text': 'It helps ensure that an object can only be modified from one place at a time.'}, {'start': '99.433', 'end': '101.033', 'text': 'See a code example, here,'}, {'start': '101.166', 'end': '103.366', 'text': 'since the constructor is only called once,'}, {'start': '103.483', 'end': '105.916', 'text': 'the box property can only have a single value,'}, {'start': '106.016', 'end': '110.083', 'text': 'given that Y and Z are different access points to the same object.'}, {'start': '110.166', 'end': '112.400', 'text': 'The main advantages of using design'}, {'start': '112.400', 'end': '115.033', 'text': 'patterns appear especially in large projects.'}, {'start': '115.233', 'end': '115.766', 'text': 'Furthermore,'}, {'start': '115.883', 'end': '118.983', 'text': "usually a junior programmer doesn't need to worry too much about them"}, {'start': '119.000', 'end': '120.300', 'text': 'One of these advantages is that,'}, {'start': '120.433', 'end': '123.533', 'text': 'as we use exactly the same solution for the same problems,'}, {'start': '123.683', 'end': '125.366', 'text': 'sharing code becomes easy,'}, {'start': '125.600', 'end': '126.516', 'text': 'as well as understanding it,'}, {'start': '126.633', 'end': '130.083', 'text': "since it's quite likely that you already know the code pattern behind it."}, {'start': '130.199', 'end': '130.466', 'text': 'Although,'}, {'start': '130.633', 'end': '131.566', 'text': 'not everything is flowers.'}, {'start': '131.716', 'end': '133.600', 'text': 'A code that implements many patterns'}, {'start': '133.600', 'end': '135.816', 'text': 'project ends up being rigid and not very flexible.'}, {'start': '136.000', 'end': '136.583', 'text': 'Furthermore,'}, {'start': '136.716', 'end': '139.900', 'text': 'Each design pattern solves some problems and creates others.'}, {'start': '140.116', 'end': '141.316', 'text': "It's a short blanket problem."}, {'start': '141.416', 'end': '142.916', 'text': 'When solving a given problem,'}, {'start': '143.116', 'end': '144.883', 'text': 'you open the flank to new problems.'}, {'start': '145.033', 'end': '147.400', 'text': "This shouldn't necessarily stop you from using them,"}, {'start': '147.516', 'end': '148.633', 'text': 'however, always do this'}, {'start': '148.633', 'end': '149.566', 'text': 'with a motive in mind.'}, {'start': '149.683', 'end': '151.166', 'text': 'Never use design patterns,'}, {'start': '151.283', 'end': '151.766', 'text': 'just because,'}, {'start': '151.883', 'end': '154.600', 'text': 'deciding when or not to use it is something that comes with experience,'}, {'start': '154.716', 'end': '157.000', 'text': 'something that even I am not able to talk about yet.'}, {'start': '157.200', 'end': '157.800', 'text': 'Furthermore,'}, {'start': '158.033', 'end': '161.716', 'text': 'even experienced programmers are constantly learning'}, {'start': '161.716', 'end': '163.783', 'text': 'using new patterns daily.'}, {'start': '163.966', 'end': '166.150', 'text': "It's not something you'll learn overnight."}, {'start': '166.233', 'end': '166.833', 'text': 'In the beginning,'}, {'start': '167.000', 'end': '170.633', 'text': 'The ideal is to just master the main ones and learn new ones throughout your career.'}, {'start': '170.800', 'end': '171.883', 'text': "Well, that's all for today."}, {'start': '172.083', 'end': '172.833', 'text': 'If you liked the video,'}, {'start': '172.883', 'end': '174.316', 'text': 'leave a like and subscribe to the channel.'}, {'start': '174.433', 'end': '175.516', 'text': 'If there is any doubt,'}, {'start': '175.633', 'end': '177.916', 'text': 'Leave a comment and I will answer, until next time.'}]