Learning Object-Oriented Programming
eBook - ePub

Learning Object-Oriented Programming

Gaston C. Hillar

Share book
  1. 280 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Object-Oriented Programming

Gaston C. Hillar

Book details
Book preview
Table of contents
Citations

About This Book

If you're a Python, JavaScript, or C# developer and want to learn the basics of object-oriented programming with real-world examples, then this book is for you.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning Object-Oriented Programming an online PDF/ePUB?
Yes, you can access Learning Object-Oriented Programming by Gaston C. Hillar in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación en Python. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785289637

Learning Object-Oriented Programming


Table of Contents

Learning Object-Oriented Programming
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
eBooks, discount offers, and more
Questions
1. Objects Everywhere
Recognizing objects from nouns
Generating blueprints for objects
Recognizing attributes/fields
Recognizing actions from verbs – methods
Organizing the blueprints – classes
Object-oriented approaches in Python, JavaScript, and C#
Summary
2. Classes and Instances
Understanding classes and instances
Understanding constructors and destructors
Declaring classes in Python
Customizing constructors in Python
Customizing destructors in Python
Creating instances of classes in Python
Declaring classes in C#
Customizing constructors in C#
Customizing destructors in C#
Creating instances of classes in C#
Understanding that functions are objects in JavaScript
Working with constructor functions in JavaScript
Creating instances in JavaScript
Summary
3. Encapsulation of Data
Understanding the different members of a class
Protecting and hiding data
Working with properties
Understanding the difference between mutability and immutability
Encapsulating data in Python
Adding attributes to a class
Hiding data in Python using prefixes
Using property getters and setters in Python
Using methods to add behaviors to classes in Python
Encapsulating data in C#
Adding fields to a class
Using access modifiers
Using property getters and setters in C#
Working with auto-implemented properties
Using methods to add behaviors to classes in C#
Encapsulating data in JavaScript
Adding properties to a constructor function
Hiding data in JavaScript with local variables
Using property getters and setters in JavaScript
Using methods to add behaviors to constructor functions
Summary
4. Inheritance and Specialization
Using classes to abstract behavior
Understanding inheritance
Understanding method overloading and overriding
Understanding operator overloading
Taking advantage of polymorphism
Working with simple inheritance in Python
Creating classes that specialize behavior in Python
Using simple inheritance in Python
Overriding methods in Python
Overloading operators in Python
Understanding polymorphism in Python
Working with simple inheritance in C#
Creating classes that specialize behavior in C#
Using simple inheritance in C#
Overloading and overriding methods in C#
Overloading operators in C#
Understanding polymorphism in C#
Working with the prototype-based inheritance in JavaScript
Creating objects that specialize behavior in JavaScript
Using the prototype-based inheritance in JavaScript
Overriding methods in JavaScript
Overloading operators in JavaScript
Understanding polymorphism in JavaScript
Summary
5. Interfaces, Multiple Inheritance, and Composition
Understanding the requirement to work with multiple base classes
Working with multiple inheritance in Python
Declaring base classes for multiple inheritance
Declaring classes that override methods
Declaring a class with multiple base classes
Working with instances of classes that use multiple inheritance
Working with abstract base classes
Interfaces and multiple inheritance in C#
Declaring interfaces
Declaring classes that implement interfaces
Working with multiple inheritance
Working with methods that receive interfaces as arguments
Working with composition in JavaScript
Declaring base constructor functions for composition
Declaring constructor functions that use composition
Working with an object composed of many objects
Working with instances composed of many objects
Summary
6. Duck Typing and Generics
Understanding parametric polymorphism and duck typing
Working with duck typing in Python
Declaring a base class that defines the generic behavior
Declaring subclasses for duck typing
Declaring a class that works with duck typing
Using a generic class for multiple types
Working with duck typing in mind
Working with generics in C#
Declaring an interface to be used as a constraint
Declaring an abstract base class that implements two interfaces
Declaring subclasses of an abstract base class
Declaring a class that works with a constrained generic type
Using a generic class for multiple types
Declaring a class that works with two constrained generic types
Using a generic class with two generic type parameters
Working with duck typing in JavaScript
Declaring a constructor function that defines the generic behavior
Working with the prototype chain and duck typing
Declaring methods that work with duck typing
Using generic methods for multiple objects
Working with duck typing in mind
Summary
7. Organization of Object-Oriented Code
Thinking about the best ways to organize code
Organizing object-oriented code in Python
Working with source files organized in folders
Importing modules
Working with module hierarchies
Organizing object-oriented code in C#
Working with folders
Using namespaces
Working with namespace hierarchies in C#
Organizing object-oriented code in JavaScript
Working with objects to organize code
Declaring constructor functions within objects
Working with nested objects that organize code
Summary
8. Taking Full Advantage of Object-Oriented Programming
Putting together all the pieces of the object-oriented puzzle
Refactoring existing code in Python
Refactoring existing code in C#
Refactoring existing code in JavaScript
Summary
Index

Learning Object-Oriented Programming

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide ...

Table of contents