Warning: mkdir(): No space left on device in /var/www/tg-me/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/beginprogrammer/--): Failed to open stream: No such file or directory in /var/www/tg-me/post.php on line 50
بدايه مبرمج | Telegram Webview: beginprogrammer/639 -
Telegram Group & Telegram Channel
SOLID Principles
(part 4)

رابع مبدأ(ISP) Interface segregation principle

- “ Clients should not be forced to depend on methods they do not use”

إذا كان يوجد كلاس يرث من Interface المفروض لا يعمل Impalement إلا للـ methods اللي هو يحتاجها .

لذلك عند بناء Interface يجب ان يكون كُل الـ methods الموجودة مرتبطة مع بعض مالم يتم تقسيمها إلا أكثر من Interface وهذا المبدأ شبيه إلا حدٍ ما من مبدأ SRP.

واقصد هُنا بالـ Interface أي جزء يستخدمه الـ client سواءً Class او Interface

مثلاً كان عندك Interface لطرق الدفع ، وشخص آخر حب يأخذ منك الواجهة هذي ويستخدمها في طريقة الدفع اونلاين

فأنت قولت له عشان تستخدم الواجهة لازم تعمل Implement للدالة الخاصة بالدفع اونلاين وكمان للدالة الخاصة بالدفع كاش عشان يشتغل معاك، طيب هو ما يحتاج الدفع كاش تجبره عليها ليش🙄؟

لذلك يتم تقسيم Interface وتكون كُل Interface خاصة بطريقة دفع مُعينه وبكذا حققنا مبدأ ISP وبنفس الوقت مبدأ SRP.

يتبع..



tg-me.com/beginprogrammer/639
Create:
Last Update:

SOLID Principles
(part 4)

رابع مبدأ(ISP) Interface segregation principle

- “ Clients should not be forced to depend on methods they do not use”

إذا كان يوجد كلاس يرث من Interface المفروض لا يعمل Impalement إلا للـ methods اللي هو يحتاجها .

لذلك عند بناء Interface يجب ان يكون كُل الـ methods الموجودة مرتبطة مع بعض مالم يتم تقسيمها إلا أكثر من Interface وهذا المبدأ شبيه إلا حدٍ ما من مبدأ SRP.

واقصد هُنا بالـ Interface أي جزء يستخدمه الـ client سواءً Class او Interface

مثلاً كان عندك Interface لطرق الدفع ، وشخص آخر حب يأخذ منك الواجهة هذي ويستخدمها في طريقة الدفع اونلاين

فأنت قولت له عشان تستخدم الواجهة لازم تعمل Implement للدالة الخاصة بالدفع اونلاين وكمان للدالة الخاصة بالدفع كاش عشان يشتغل معاك، طيب هو ما يحتاج الدفع كاش تجبره عليها ليش🙄؟

لذلك يتم تقسيم Interface وتكون كُل Interface خاصة بطريقة دفع مُعينه وبكذا حققنا مبدأ ISP وبنفس الوقت مبدأ SRP.

يتبع..

BY بدايه مبرمج




Share with your friend now:
tg-me.com/beginprogrammer/639

View MORE
Open in Telegram


بدايه مبرمج Telegram | DID YOU KNOW?

Date: |

The messaging service and social-media platform owes creditors roughly $700 million by the end of April, according to people briefed on the company’s plans and loan documents viewed by The Wall Street Journal. At the same time, Telegram Group Inc. must cover rising equipment and bandwidth expenses because of its rapid growth, despite going years without attempting to generate revenue.

The seemingly negative pandemic effects and resource/product shortages are encouraging and allowing organizations to innovate and change.The news of cash-rich organizations getting ready for the post-Covid growth economy is a sign of more than capital spending plans. Cash provides a cushion for risk-taking and a tool for growth.

بدايه مبرمج from us


Telegram بدايه مبرمج
FROM USA