Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ฟีเจอร์แบบ Object Oriented Programming

Object-oriented programming (OOP) คือวิธีในการ model โปรแกรม Object ในฐานะแนวคิดเชิงโปรแกรมถูกแนะนำในภาษาโปรแกรม Simula ในทศวรรษ 1960 Object เหล่านั้นมีอิทธิพลต่อ architecture programming ของ Alan Kay ที่ object ส่งข้อความกันและกัน เพื่ออธิบาย architecture นี้ เขา ประดิษฐ์คำว่า object-oriented programming ในปี 1967 นิยามที่ แข่งกันหลายตัวอธิบายว่า OOP คืออะไร และโดยบางนิยามเหล่านี้ Rust เป็น object oriented แต่โดยอื่นไม่ใช่ ในบทนี้ เราจะสำรวจลักษณะ บางอย่างที่พิจารณาทั่วไปว่าเป็น object oriented และวิธีที่ลักษณะ เหล่านั้นแปลเป็น Rust idiomatic เราจะแสดงวิธี implement object-oriented design pattern ใน Rust และพูดถึง trade-off ของการ ทำเช่นนั้นเทียบกับการ implement วิธีแก้โดยใช้บางจุดแข็งของ Rust แทน