How to use Factory Method Design Pattern to design a course website like Udacity, Edx, Coursera...

preview_player
Показать описание
Learning system design is not a one time task. It requires regular effort and consistent curiosity to build large scale systems. Moreover, every system has different requirements and meeting them requires expertise and people with varied and specific knowledge. There are a lot of resources to learn through videos. But not everyone enjoys that mode of learning. Instead some people understand things better by reading and thinking on the points put forward by the author. Such people can access these in different ways - blogs, articles and books. We have come up with this video to put light on one such aspect, that is - Types of Design Patterns

Important links and resources:

------------------------------------------------------------------
Recommendations
------------------------------------------------------------------
Our full courses on youtube:

Some paid courses that we recommend:

------------------------------------------------------------------
About Us
------------------------------------------------------------------
Created and Instructed by:
Yogita Sharma

Post-production(editing, thumbnail etc) managed by:
CiKi

Colors and design by:
Naini Todi

Both Arpit and Yogita are software engineers and want to help other software engineers become better by providing high quality and well researched content by adding their creativity and teaching twist.

------------------------------------------------------------------
Join Us
------------------------------------------------------------------
Hangout with sudoCode:

For business:

Timestamps:
0:00 - Intro
0:29 - What is Factory Design Pattern?
2:40 - Concept of Factory Design Pattern
4:57 - Analogy of a Factory
3:30 - Why choose object and classes for categorizing design patterns?
6:19 - Real world example and application
7:42 - Code walk-through
12:11 - Pros and Cons
13:41 - Summary
Рекомендации по теме
Комментарии
Автор

I presented similar design in one of the tech interviews and was questioned on breaking OCP in factory class.
Though this is mostly taught by most authors for explaining the concept, in reality, we can avoid switch case with map so factory method just look up the map and return the value. Now to build the map, we have two choices
1. Provide register product method in factory so product can register itself and then can be returned
2. Use reflection to load classes in a map at startup. Map is maintained by factory class. Map key is identifier used in switch case and value is return type of factory method.

curiossoul
Автор

The best playlist on Design Patterns I have seen so far. Your way of explanation, examples, animations everything is top notch. Thanks a million to you.

techforpeace
Автор

The second example was little bit complicated but I really like createVehicle example. Thank you for explaining in easy manner.

lapimpale
Автор

Before coming to this tutorial, I am having, doubts about design pattern but the way explained all the things it is easy to understand.
Thank you very much for such informative video ☺

sarinkumarpatle
Автор

9:51 CreateCourse() is not the meat and potatoes of the Factory pattern. The Factory pattern relies on delegating the object creation to a class specialized for this purpose. The underlying mechanisms of the actual creation vary by use case and are beyond the scope of the Factory pattern.

mireazma
Автор

Great example. If you can also explain the code flow through debugger, that will help to understand code much better.

manishperiwal
Автор

Very well explained, have been searching for the videos and got this. You saved my life. Thank you ❤

shabanaasmi
Автор

1. 2:28 the class that implements the creation logic is wrongfully called "concrete" class, or subclass, that implement the factory method interface. The "factory" class need not be an abstraction for the creation implemention but a totally separated class. This is because you want to decouple the objects being created, from the factory (see 5.).
2. 2:56 the same thing. You say that the FactoryClass is abstract or an interface.
3. 4:40 the concrete class is _not_ hidden from the interface that it implements, it just can't be. But it is hidden from the client.
4. 9:51 In the Course example you make the Course class abstract. Furthermore you have an abstract method named createCourse() which would suggest it's responsible for the underlying logic of a factory method like newing the Course. In fact it has to do with inner composition of a Course but not with its instantiation.
5. You made the CourseFactory not an abstract class/interface and well you did. But remember what you said in 1. and 2. But you name the instantiating code getCourse() which would suggest it returns a permanent unique field of the class. You should name _this_ createCourse() or just create().

mireazma
Автор

You are amazing! Thanks for creating HLD, LLD, and Design patterns courses.

srivatsa
Автор

This is an amazing video. Thank you for the wonderful explanation. First time I understood what Factory method pattern is actually meant for.

gilbert.gabriel
Автор

Bahut kam log samjha pate hai is tarah ! Aap unme se ek hai. Thanks for this explaination, I was wondering why this series is not resumed, Hoping you will continue and we will get best out of this series !

ganeshkhirwadkar
Автор

Nmrl parça, finalmente consegui entender o bgl, tmj

felipekobra
Автор

In which of the scenarios would you use factory pattern and why?
Consuming a service
Complex Validation
Logging
Data Binding
None of the Above

jagmohangautam
Автор

What is the program you use to create class diagrams???

pauladityashaw
Автор

does it corelate to open / close principle. if one of the new requirement there will be modification, any alternative for this ?

bollywoodssongs
Автор

Where can we find the code that was explained in the video ?

SaiSumanthKovuru
Автор

Wait ! Whats that VS Code extension for generating class diagram

manishkumarprajapati
Автор

I really love your video editing work 😍

gokulsrinivasan
Автор

Hello and geetings from Bulgaria.

I like your energetic and well explained courses. However ...

I can see for last ... many years that it is the Indian scholars pushing the abstract methods while many other have given them up. For ex. the whole C# platform is based on the implementation of interfaces. Which in OOP terms gives us the "is a" relationships. Down the line that also help to implement the very modern now concepts like dependency injection and automatic unit tests. In both cases we can inject an object as another object's "has a", as well as we can inject a Mock object with pre-setup return values. That is for as long as those objects implement the desired interfaces.

I would love to engage you on small chat / discussion about that.

Thank you,
ILIIA

mocococo
Автор

Hi Arpita, can you please take more use cases for Low-level design eg. Parking lot, School Management Systems, Hospital Management System, etc?

jasper