somewhere in... blog
x
ফোনেটিক ইউনিজয় বিজয়

Software Engineering: Basic Understanding about Creational Design Patterns

২৫ শে সেপ্টেম্বর, ২০১০ রাত ১০:৫৯
এই পোস্টটি শেয়ার করতে চাইলে :

Singleton - Ensure that only one instance of a class is created and Provide a global access point to the object.

Singleton pattern should be used when we must ensure that only one instance of a class is created and when the instance must be available through all the code. A special care should be taken in multithreading environments when multible threads must access the same resources throught the same singleton object.

Factory(Simplified version of Factory Method) - Creates objects without exposing the instantiation logic to the client and Refers to the newly created object through a common interface.

Factory pattern should be used when: - a framework delegate the creation of objects derived from a common superclass to the factory - we need flexibility in adding new types of objects that must be created by the class.

Factory Method - Defines an interface for creating objects, but let subclasses to decide which class to instantiate and Refers to the newly created object through a common interface.

Factory Method pattern should be used when:
- a framework delegate the creation of objects derived from a common superclass to the factory
- the base factory class does not know what concrete classes will be required to create - delegates to its subclasses the creation of concrete objects
- factory subclasses subclasses are aware of the concrete classes that must be instantiated

Factory method pattern, compared to Factory pattern replace the factory with an abstract class and a set of concrete factories subclasses. The subclasses are responsible for creating concrete product objects; for factory method is possible adding new product classes without changing the abstract factory. The same result can be achieved for simplified factory pattern if reflection is used.

Abstract Factory - Offers the interface for creating a family of related objects, without explicitly specifying their classes.

Abstract Factory should be used when:

* A system should be configured with one of multiple families of products
* A system should be independent of how its products are created, composed and represented
* Products from the same family should be used all together, products from different families ahould not be used togheter and this constraint must be ensured.
* Only the product interfaces are revealed, the implementations remains hidden to the clients.

Builder - Defines an instance for creating an object but letting subclasses decide which class to instantiate and Allows a finer control over the construction process.

Prototype - Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.


সর্বশেষ এডিট : ২৬ শে সেপ্টেম্বর, ২০১০ সন্ধ্যা ৭:৫৫
০টি মন্তব্য ০টি উত্তর

আপনার মন্তব্য লিখুন

ছবি সংযুক্ত করতে এখানে ড্রাগ করে আনুন অথবা কম্পিউটারের নির্ধারিত স্থান থেকে সংযুক্ত করুন (সর্বোচ্চ ইমেজ সাইজঃ ১০ মেগাবাইট)
Shore O Shore A Hrosho I Dirgho I Hrosho U Dirgho U Ri E OI O OU Ka Kha Ga Gha Uma Cha Chha Ja Jha Yon To TTho Do Dho MurdhonNo TTo Tho DDo DDho No Po Fo Bo Vo Mo Ontoshto Zo Ro Lo Talobyo Sho Murdhonyo So Dontyo So Ho Zukto Kho Doye Bindu Ro Dhoye Bindu Ro Ontosthyo Yo Khondo Tto Uniswor Bisworgo Chondro Bindu A Kar E Kar O Kar Hrosho I Kar Dirgho I Kar Hrosho U Kar Dirgho U Kar Ou Kar Oi Kar Joiner Ro Fola Zo Fola Ref Ri Kar Hoshonto Doi Bo Dari SpaceBar
এই পোস্টটি শেয়ার করতে চাইলে :
আলোচিত ব্লগ

ব্যস্ত বেকার

লিখেছেন বাকপ্রবাস, ৩০ শে মে, ২০২৪ দুপুর ১২:২৫

আমার এই অবস্থা
আপনার কী অবস্থা কমেন্ট করে জানান:

ছড়া লেখা হয়না
রান্নার পোষ্ট হয়না
ফেইসবুকে কম আসা হয়
ব্লগ পোষ্ট হয়ান
কারণ : ফ্রিল্যান্স কোর্সে যুক্ত আছি, তায় অন্যসব থেকে দূরে আছি কারণ সময় পাইনা
ফ্রিল্যান্স... ...বাকিটুকু পড়ুন

ক্যারিয়ার কথন: ফ্রিল্যান্সিং, আউটসোর্সিং এবং সর্তকতা।

লিখেছেন জাদিদ, ৩০ শে মে, ২০২৪ দুপুর ১:২৪

গত কয়েক বছরে বাংলাদেশে ফ্রিল্যান্সিং, পেশা হিসাবে বেশ জনপ্রিয় হয়ে উঠেছে। সম্মানজনক সামাজিক স্বীকৃতি পাওয়ায় অনেকেই এই পেশায় যুক্ত হয়ে আগ্রহ প্রকাশ করছেন। এছাড়া বাংলাদেশে কর্মক্ষেত্রে একজন মানুষকে... ...বাকিটুকু পড়ুন

আজ মনটা কেমন যেন অনেক কিছু চিন্তা করছে।

লিখেছেন নাহল তরকারি, ৩০ শে মে, ২০২৪ বিকাল ৪:৩৮



সকালের মৃদু আলোয় মোড়ানো একটি মনোরম দৃশ্য ধরা পড়েছে এই ছবিতে। এটি একটি খোলা জায়গা, যেখানে সবুজের সমারোহ এবং প্রকৃতির ছোঁয়া স্পষ্ট। ছবির বাম দিকে গাছের সারি এবং ডান... ...বাকিটুকু পড়ুন

তোমার ভাঁজ খোলো আনন্দ দেখাও :: দু শ'রও বেশি পুরোনো ব্লগারের প্রোফাইল পিকচার নিয়ে একটি মিউজিক ভিডিও

লিখেছেন সোনাবীজ; অথবা ধুলোবালিছাই, ৩০ শে মে, ২০২৪ রাত ৯:৫৭

১৫ সেপ্টেম্বর ২০১২ তারিখে সামহোয়্যারইন ব্লগের দু শ'রও বেশি ব্লগারের প্রোফাইল পিকচার নিয়ে বানানো একটা মিউজিক ভিডিও শেয়ার করেছিলাম। যে-সব ব্লগার ঐ সময়ে অ্যাক্টিভ ছিলেন, প্রোফাইল পিকচারগুলো তাদের ছিল।



কয়েকদিন... ...বাকিটুকু পড়ুন

রহস্যময় কলা

লিখেছেন বিষাদ সময়, ৩০ শে মে, ২০২৪ রাত ১১:৩১




এই কলা শব্দটা আমার কাছে পুরাই বিভ্রান্তিকর। নারীদের কলা বলতে যে ছলাকলা সেটা ভালই বুঝি। সেই ছলাকলা দেখে গলা বাড়ালেই যে ষোলকলা পূর্ণ হয় সেটাও জানা। কিন্তু এই... ...বাকিটুকু পড়ুন

×