Object Oriented C++ for Science and Engineering

Dr. Okon H Akpan

  • 出版商: CreateSpace Independ
  • 出版日期: 2014-07-27
  • 售價: $1,840
  • 貴賓價: 9.5$1,748
  • 語言: 英文
  • 頁數: 376
  • 裝訂: Paperback
  • ISBN: 1500474401
  • ISBN-13: 9781500474409
  • 相關分類: C++ 程式語言
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

This book introduces the object oriented programming concepts and demonstrates their use in building correct and efficient codes using the syntactic features of C++. Given the fact that most of the modern high-level programming languages have some object oriented programming capability, the book uses the linguistic features of C++ to present the inherent mechanisms of object oriented programming and the code building process which use them in such a way that what is learned from this book can be extended to other programming languages like Perl, Java, Python, C#, and many others. Those “inherent mechanisms” of object oriented programming are abstraction, inheritance, and polymorphism. We all know that an effective use of any concept in science or engineering for solution of practical problems always requires a mastery of certain body of knowledge over and about that concept which, in the case of object oriented programming as a solution methodology, embodies abstraction and inheritance and polymorphism. The book gives a detailed coverage of these programming mechanisms and backs the treatment with ample demonstrations of their use in code building process. That process, as emphasized in this book, always passes through the three phases: object oriented analysis phase (OOA), object oriented design phase (OOD), and object oriented programming phase (OOP.) What results from this process is an object oriented program, a program which is populated with real-world objects which interact in some ways to solve problems. Most of the programming demonstrations are complete programs which are ready to be compiled and executed. This book also gives a detailed coverage of how the program’s objects relate with one another in the course of their interaction to solve problems. That relationship is afforded with the programming mechanisms of inheritance and composition. In the case of C++, for example, there is another relationship called a friend of class which is a colorful name given to any code which does not belong in the class but to which the class grants a privilege to access its private members. Because a friend of class can access the private properties of its class, it presents a serious security risk not only to the class itself and the program that uses the class but also to the systems (computers, networks, etc.) on which the program runs. (Every programming feature – not only friend of class – presents some security risks which are often exploited by “bad people” to hack the systems or infect them with some malware codes – viruses, worms, Trojans, etc.) This book does not dwell on the security “holes” in the object oriented programming features nor on the dangers they pose. Such will come later -- in more advanced texts. First things first: the only purpose of this book, the sole reason for its existence, is to use the language of C++ to introduce the object oriented programming concepts and demonstrate their application in code buildings.

商品描述(中文翻譯)

本書介紹了物件導向程式設計的概念,並展示如何利用 C++ 的語法特性來構建正確且高效的程式碼。考慮到大多數現代高階程式語言都具備某種物件導向程式設計的能力,本書利用 C++ 的語言特性來呈現物件導向程式設計的內在機制及其在程式碼構建過程中的應用,讓讀者能將本書所學延伸至其他程式語言,如 Perl、Java、Python、C# 等等。物件導向程式設計的這些「內在機制」包括抽象、繼承和多型。

我們都知道,科學或工程中任何概念的有效運用以解決實際問題,總是需要對該概念的某些知識體系的掌握。在物件導向程式設計作為解決方法的情況下,這些知識體系體現了抽象、繼承和多型。本書詳細介紹了這些程式設計機制,並以豐富的範例展示它們在程式碼構建過程中的應用。正如本書所強調的,這一過程總是經歷三個階段:物件導向分析階段(OOA)、物件導向設計階段(OOD)和物件導向程式設計階段(OOP)。這一過程的結果是一個物件導向程式,該程式由與現實世界物件互動的實體組成,以解決問題。大多數程式範例都是完整的程式,隨時可以編譯和執行。

本書還詳細介紹了程式中的物件在互動過程中如何相互關聯。這種關聯是通過繼承和組合的程式設計機制來實現的。以 C++ 為例,還有一種稱為類的朋友(friend of class)的關係,這是一個形象的名稱,指的是任何不屬於該類的程式碼,但該類授予其訪問私有成員的特權。由於類的朋友可以訪問其類的私有屬性,因此對於該類本身及使用該類的程式,甚至運行該程式的系統(如電腦、網路等)來說,這都構成了嚴重的安全風險。(每一個程式特性——不僅僅是類的朋友——都存在某些安全風險,這些風險常常被「壞人」利用來入侵系統或感染惡意程式碼,如病毒、蠕蟲、木馬等。)

本書不會深入探討物件導向程式設計特性中的安全「漏洞」或它們所帶來的危險。這些內容將在更高級的文本中討論。首先,這本書的唯一目的、存在的唯一理由,是利用 C++ 語言來介紹物件導向程式設計的概念並展示其在程式碼構建中的應用。