Introduction to Visitor Design Pattern - Design Pattern Tutorial смотреть онлайн
Introduction to Visitor Design Pattern is a free tutorial by Paulo Dichone | Android, Java, Flutter Developer and Teacher from Design Pattern course
Link to this course(Special Discount):
https://www.udemy.com/course/java-design-patterns-the-complete-masterclass/?ranMID=39197&ranEAID=Gw%2FETjJoU9M&ranSiteID=Gw_ETjJoU9M-SdMHOHZxWK4rArUd6eWJJg&utm_source=aff-campaign&LSNPUBID=Gw%2FETjJoU9M&utm_medium=udemyads
This is the best Design Pattern Course
Course summary:
Master Java Design Patterns
Apply Design Patterns to Real-World Projects
Build Software that's Robust and Flexible Using Java Design Patterns
Solve common Software architecture problems with Java Design Patterns
English [Auto]
All right let's talk about the visit or design pattern. Now imagine that we have a store and this store we sell clothing items so we can have different kinds of clothing items as you wish hundreds of thousand of those. And each item of course all these items usually have the retail price and the tax price. Now let's imagine that for each item that we sell on this in this store each item has different tax that they have to pay. Let's say a tank top has a 10 percent taxation on top of the retail price and the T-shirt has 15 percent or so for it. These are just numbers. I'm coming out with them OK. So the obvious solution would be to have each of these items. Now when I say each of these items I'm talking about the structure of the code we have for instance for a T-shirt class we would have for instance would have a method where we calculate the teeshirt taxes. Right. So retail price and taxes so that when we call the price for the for that T-shirt then we wouldn't be able to return the retail plus the tax rate for each one of these items would have to do the same which means we have to go through through all these classes which means you have to change the structure of each model class to order to accommodate that. Assuming that each one has different taxation point. So it not the right of way. That's not that is not efficient that's not a good use of our time and which means the solution is what we call the visceral design pattern. So what this will do for each of these items we will make sure that we create an interface that will take care of the algorithm needed to calculate each individual to attach to each each of these items that are attached. Each of these items. What are the calculations will happen and we can change those calculations or whatever else you can do individually as opposed to having to change to meddle with the actual class model. OK so if you look back at the Strategy pattern is quite kind of that by the same idea here is like we creating a little algorithms that will allow us to change it depending on the item the behavior that we want. So for a t shirt we can make sure that this T-shirt class model will implement a visa which will allow us to add those methods that will for instance get the correct taxation for each of those items. So now we don't have to literally go to each of these model class like t shirt or tank top and so forth and code up all of that because that obviously wouldn't be efficient. OK. So what I'm trying to say here is that the Vesely design pattern allows us is very important allows us to add methods to classes of different types you don't have to be different types can be the same types but it's a whole different types without much altering to those classes. This is the key. We're not altering the original classes Okay. So the diagram would look like they would have a visible interface right which would say would have a method called Except and will pass in a vizard. In this case we'll return it double the price. Right. So for instance now we have a concrete class of say a jacket will implement Divis rule which means now through the kind we can actually create different implementation of the visitor had a visible visitor interface which has those overload we can have different method. But in this case we have those those overloaded constructors and we noticed we passed there different types T shirt shirt or jacket. So say noticed now we've compartmentalise everything so we can have for instance the discount visita which will take care of all of those classes that need discount. For instance if we say that T-shirt now needs to have it does sound visiter which means it has to subtract certain the amount that the user has to pay. So we can just use that as opposed to going to each t shirt or whatever item that we are trying to use. And Kodo selves all of that logic. OK. So we can create all these different kind of visa rules which we can use in our client for instance jacket and passes visa walking past Texas visit or for instance for our Jaggar we could pass also discount visa or we can pass any other type of interface or or properties that we want to change. Perfect. So this is why we're going to be looking at in the next vi
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Introduction to Visitor Design Pattern - Design Pattern Tutorial» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.