اصل قابلیت جانشینی در طراحی کلاس ها – LSP


Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /home/musicmai/public_html/prodev/prodev/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

LSP مخفف عبارت Liskov Substitutability Principle می باشد و منظور از آن ارایه قانونی است که هنگام طراحی کلاس ها باید رعایت شود به گونه ای که بتوان instance های کلاس وارث را به جای instance های کلاس پایه در برنامه به کار برد. بنابراین می توان از آن به عنوان یک راهنما هنگام نوشتن کلاس های جدید استفاده کرد.

بیشتر بخوانید