Object Oriented Programming Language

1.What are the advantages of Object Oriented Programming Languages(OOPL)?

It directly represent the real life objects like Car, Account, Customer etc.

The features of OOPL like polymorphism, inheritance, encapsulation(Tip: remember “Pie”) make it powerful.

 

2.How does the Object Oriented approach improve software development?

The key benefits are:

Re-use of previous work: using implementation inheritance and object composition.

Real mapping to the problem domain: Objects map to real world and represent customers, products etc with encapsulation.

Modular architecture: Objects, systems, frameworks etc are the building blocks of larger systems.

 

In the conclusion, OO is used to increase the software quality and reduce development time. If 90% of the new application consists of proven existing components then only the remaining 10% of the code have to be tested from scratch.

 

3. What do you mean by polymorphism, inheritance, encapsulation and dynamic binding?

Polymorphism allows values of different data types to be handled by using a uniform interface. The benefit of polymorphism is that it is very easy to add new classes of derived objects without breaking the calling code.

Dynamic binding is the process used by object-oriented programming languages to implement polymorphism

Inheritance is the inclusion of methods and variables of a base class in a derived class so that they are accessible in that derived class. The benefit of inheritance is that it provides the formal mechanism for code reuse.

Encapsulation refers to keeping all the related members(variables and methods) together in an object. Good encapsulation improves code modularity by preventing objects interacting with each other in an unexpected way.

 

4. Why would you prefer code reuse via composition over inheritance?

Object composition and inheritance are two techniques for reusing functionality in object-oriented systems.

 


Figure 1. The inheritance relationship

 

Figure 2. The composition relationship

 

Inheritance

Composition

It is done statically at compile time and is easy to use.

It is done dynamically at run-time.

Subclass becomes dependent on the parent class implementation. Inheritance breaks encapsulation.

The implementations can be replaced at run-time. The behavior of the system may be harder to understand just by looking at the source code.

This type of reuse is often called white-box reuse.

This type of reuse is often called black-box reuse.

 

Overuse inheritance will result in large inheritance hierarchies that can become hard to deal with. Furthermore, due to the flexibility and power of object composition, most design patterns emphasize object composition over inheritance.

Essential concepts of programming language design and implementation are explained and illustrated in the context of the object-oriented programming language (OOPL) paradigm. Written with the upper-level undergraduate student in mind, the text begins with an introductory chapter that summarizes the essential features of an OOPL, then widens the discussion to categorize the other major paradigms, introduce the important issues, and define the essential terms. After a brief second chapter on event-driven programming (EDP), subsequent chapters are built around case studies in each of the languages Smalltalk, C++, Java, C#, and Python. Included in each case study is a discussion of the accompanying libraries, including the essential container classes. For each language, one important event-driven library is singled out and studied. Sufficient information is given so that students can complete an event-driven project in any of the given languages. After completing the course the student should have a solid set of skills in each language the instructor chooses to cover, a comprehensive overview of how these languages relate to each other, and an appreciation of the major issues in OOPL design. Key Features Provides essential coverage of Smalltalk origins, syntax, and semantics, a valuable asset for students wanting to understand the hybrid Objective C language Includes a companion disc with source code and figures from the text. Provides detailed case studies of Smalltalk, Java, C++, C#, and Python and features a side-by-side development of the Java and C++ languages--highlighting their similarities and differences Sets the discussion in a historical framework, tracing the roots of the OOPLs back to Simula 67 Provides broad-based coverage of all languages, imparting essential skills as well as an appreciation for each language’s design philosophy Includes chapter summary, review questions, and exercises in each chapter, and an appendix with event-driven projects. Table of Contents Chapter 1 A Context-Sensitive Introduction Chapter 2 Event-Driven Programming Chapter 3 Smalltalk and the Squeak Environment Chapter 4 C++ and Java Commonalities and Similarities Chapter 5 Additional Concepts from the C++ Language Chapter 6 Visual Studio and the Microsoft Foundation Classes Chapter 7 Java and the Swing Library Chapter 8 C# and the Common Language Infrastructure Chapter 9 Python
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值