SOLID principle exceptions

ساخت وبلاگ

Vote count: 0

I try to apply SOLID principles in my project's class design.Are there any exceptions of SOLID principles? Do we HAVE to apply these principle DEFINITILY.For example i prepared a factory class.

class XAdderFactory
{ private Person _person; public bool PersonHasNoRecords { get { return string.IsNullOrEmpty(_person.HasXRecords); } } public XAdderFactory(Person person) { this._person = person; if (PersonHasNoRecords) { new XListMakerAFactory(person); } else { new XListMakerB(person); } }
}

This class never confirm the OCP principle.New type list maker maybe required in future and i must add new else if block.Is my design bad?Or are there exceptions of SOLID princples that not mentioned mmuch.I do not know exactly my example comply "Strategic Closure" of OCP? If you have another examples it would be helpfull.

asked 44 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 256 تاريخ : شنبه 6 شهريور 1395 ساعت: 20:52