Using Factory method pattern in Java project

Pubblicato il: 16 settembre 2020
sul canale di: Improve Your Programming skills
62
1

Factory method(creational design pattern) helps create the object its caller does not need to know how to create that object. The caller only needs to pass the parameters, the function will know what object it has to create to return.

For example, when calling the factory method
createMilkProduct(SweetenedMilk)
It returns sweetened milk product

createMilkProduct(UnSweetenedMilk)
It returns un-sweetened milk product

createMilkProduct(StrawberryMilk)
It returns strawberry milk product


In questa pagina del sito puoi guardare il video online Using Factory method pattern in Java project della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Improve Your Programming skills 16 settembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 62 volte e gli è piaciuto 1 spettatori. Buona visione!