TAILIEUCHUNG - Software Engineering For Students: A Programming Approach Part 20

Software Engineering For Students: A Programming Approach Part 20. This fully revised version of Doug Bell's Software Engineering: A Programming Approach continues to use the successful formula of the previous editions. The author's approach is to present the main principles, techniques and tools used in software engineering, one by one, chapter by chapter. This book is a unique introduction to software engineering for all students of computer science and its related disciplines. It is also ideal for practitioners wishing to remain current with new developments in the area | 168 Chapter 13 Refactoring One way in which a class can become very small is when it has been the subject of the Move Method and the Move Variable refactorings so that it has become sucked dry. This illustrates how many of the refactorings are interconnected - using one leads to using another and so on. SELF-TEST QUESTION Compare the factoring Inline Class with the factoring Extract Class. Identify composition or inheritance Once we have identified the classes within a software system the next step is to review the relationships between the classes. The classes that make up the software collaborate with each other to achieve the required behavior but they use each other in different ways. There are two ways in which classes relate to each other 1. composition - one object creates another object from a class using new. An example is a window object that creates a button object. 2. inheritance - one class inherits from another. An example is a class that extends the library Frame class. The important task of design is to distinguish these two cases so that inheritance can be successfully applied or avoided. One way of checking that we have correctly identified the appropriate relationships between classes is to use the is-a or has-a test the use of the phrase is-a in the description of an object or class signifies that it is probably an inheritance relationship. the use of the phrase has-a indicates that there is no inheritance relationship. Instead the relationship is composition. An alternative phrase that has the same meaning is consists-of . We return to the cyberspace invaders game designed in Chapter 11 seeking to find any inheritance relationships. If we can find any such relationships we can simplify and shorten the program making good use of reuse. In the game several of the classes - Defender Alien Laser and Bomb - incorporate the same methods. These methods are getX getY getHeight and getWidth that obtain the position and size of the graphical .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.