You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/09-classes/07-mixins/article.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,12 +197,12 @@ menu.choose("123");
197
197
198
198
و `eventMixin` اضافه کردن چنین رفتاری به هر چند کلاسی که بخواهیم را آسان میکند، بدون اینکه کاری به زنجیره ارثبری داشته باشیم.
199
199
200
-
## Summary
200
+
## خلاصه
201
201
202
-
*Mixin* -- is a generic object-oriented programming term: a class that contains methods for other classes.
202
+
*Mixin* -- یک عبارت عام برنامهنویسی شیءگرا است: کلاسی که متدهایی را برای کلاسهای دیگر دربرمیگیرد.
203
203
204
-
Some other languages allow multiple inheritance. JavaScript does not support multiple inheritance, but mixins can be implemented by copying methods into prototype.
204
+
بعضی از زبانهای دیگر ارثبری چندگانه را ممکن میسازند. جاوااسکریپت از ارثبری چندگانه پشتیبانی نمیکند اما با کپی کردن متدها درون پروتوتایپ mixinها میتوانند پیادهسازی شوند.
205
205
206
-
We can use mixins as a way to augment a class by adding multiple behaviors, like event-handling as we have seen above.
206
+
ما میتوانیم با اضافه کردن چند عملکرد، از mixinها به عنوان راهی برای قدرتمند کردن یک کلاس استفاده کنیم، مانند کنترل کردن رویداد که بالاتر آن را دیدیم.
207
207
208
-
Mixins may become a point of conflict if they accidentally overwrite existing class methods. So generally one should think well about the naming methods of a mixin, to minimize the probability of that happening.
208
+
اگر mixinها به طور تصادفی متدهای موجود در کلاس را بازنویسی کنند، ممکن است باعث ایجاد تناقض شوند. پس به طور کلی باید درباره نامگذاری متدهای یک mixin به خوبی فکر کنید تا احتمال اتفاق افتادن چنین چیزی را کم کنید.
0 commit comments