You are previewing Beginning C# Object-Oriented Programming, Second Edition.
O'Reilly logo
Beginning C# Object-Oriented Programming, Second Edition

Book Description

Learn C# with Beginning C# Object-Oriented Programming and you'll be thinking about program design in the right way from day one. Whether you want to work with .NET for the web or desktop, or for Windows 8 on any device, Dan Clark's accessible, quick-paced guide will give you the foundation you need for a successful future in C# programming.

In this book you will:

  • Master the fundamentals of object-oriented programming

  • Work through a case study to see how C# and OOP work in a real-world application

  • Develop techniques and best practices that lead to efficient, reusable, elegant code

  • Discover how to transform a simple model of an application into a fully-functional C# project.

With more than 30 fully hands-on activities, Beginning C# Object-Oriented Programming teaches you how to design a user interface, implement your business logic, and integrate your application with a relational database for data storage. Along the way, you will explore the .NET Framework, ASP.NET and WinRT. In addition, you will develop desktop, mobile and web-based user interfaces, and service-oriented programming skills, all using Microsoft's industry-leading Visual Studio 2012, C#, the Entity Framework, and more. Read this book and let Dan Clark guide you in your journey to becoming a confident C# programmer.

What you'll learn

  • Lay the foundations of great C# programming by understanding object-oriented programming (OOP) principles.

  • Understand how OOP can be applied across desktop, web and mobile worlds in Windows today.

  • Learn to use the Universal Modeling Language (UML) to quickly design an application correctly from the first attempt.

  • Discover the .NET Framework, ASP.NET and WinRT and how they can help you create applications quickly and efficiently.

  • Walk along as the author guides you through a final challenge, to develop a complete application using a wide range of the techniques and best practices covered inside.

Who this book is for

If you want to learn C# while gaining a foundation in object-oriented programming that will get you thinking about program design in the right way from day one, this book is for you.

Table of Contents

  1. Title Page
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Author
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Introduction
  9. CHAPTER 1: Overview of Object-Oriented Programming
    1. What is OOP?
    2. The History of OOP
    3. Why Use OOP?
    4. The Characteristics of OOP
    5. The History of C#
    6. Summary
  10. CHAPTER 2: Designing OOP Solutions: Identifying the Class Structure
    1. Goals of Software Design
    2. Understanding the Unified Modeling Language
    3. Developing a SRS
    4. Introducing Use Cases
    5. Understanding Class Diagrams
    6. Modeling Object Relationships
    7. Summary
  11. CHAPTER 3: Designing OOP Solutions: Modeling the Object Interaction
    1. Understanding Scenarios
    2. Introducing Sequence Diagrams
    3. Message Types
    4. Recursive Messages
    5. Message Iteration
    6. Message Constraints
    7. Message Branching
    8. Understanding Activity Diagrams
    9. Exploring GUI Design
    10. Summary
  12. CHAPTER 4: Designing OOP Solutions: A Case Study
    1. Developing an OOP Solution
    2. Summary
  13. CHAPTER 5: Introducing the .NET Framework and Visual Studio
    1. Introducing the .NET Framework
    2. Using the Visual Studio Integrated Development Environment
    3. Summary
  14. CHAPTER 6: Creating Classes
    1. Introducing Objects and Classes
    2. Defining Classes
    3. Using Constructors
    4. Overloading Methods
    5. Summary
  15. CHAPTER 7: Creating Class Hierarchies
    1. Understanding Inheritance
    2. Overriding the Methods of a Base Class
    3. Overloading Methods of a Base Class
    4. Hiding Base Class Methods
    5. Implementing Interfaces
    6. Understanding Polymorphism
    7. Summary
  16. CHAPTER 8: Implementing Object Collaboration
    1. Communicating Through Messaging
    2. Defining Method Signatures
    3. Passing Parameters
    4. Understanding Event-Driven Programming
    5. Understanding Delegation
    6. Implementing Events
    7. Responding To Events
    8. Windows Control Event Handling
    9. Handling Exceptions in the .NET Framework
    10. Static Properties and Methods
    11. Using Asynchronous Messaging
    12. Summary
  17. CHAPTER 9: Working with Collections
    1. Introducing the .NET Framework Collection Types
    2. Working with Arrays and Array Lists
    3. Using Generic Collections
    4. Programming with Stacks and Queues
    5. Summary
  18. CHAPTER 10: Implementing the Data Access Layer
    1. Introducing ADO.NET
    2. Working with Data Providers
    3. Establishing a Connection
    4. Executing a Command
    5. Using the DataReader Object to Retrieve Data
    6. Using the DataAdapter to Retrieve Data
    7. Working with DataTables and DataSets
    8. Working with the Entity Framework
    9. Querying Entities with LINQ to EF
    10. Updating Entities with the Entity Framework
    11. Summary
  19. CHAPTER 11: Developing WPF Applications
    1. Windows Fundamentals
    2. Introducing XAML
    3. Using Layout Controls
    4. Adding Display Controls
    5. Using the Visual Studio Designer
    6. Handling Control Events
    7. Creating and Using Dialog Boxes
    8. Presenting a MessageBox to the User
    9. Creating a Custom Dialog Box
    10. Data Binding in Windows-Based GUIs
    11. Binding Controls Using a DataContext
    12. Creating and Using Control and Data Templates
    13. Summary
  20. CHAPTER 12: Developing Web Applications
    1. Web Pages and Web Forms
    2. Web Server Control Fundamentals
    3. Understanding Web Page and Web Server Control Inheritance Hierarchy
    4. Using the Visual Studio Web Page Designer
    5. The Web Page Life Cycle
    6. Control Events
    7. Understanding Application and Session Events
    8. Storing and Sharing State in a Web Application
    9. Data-Bound Web Controls
    10. Summary
  21. CHAPTER 13: Developing Windows Store Applications
    1. Building the User Interface
    2. Using Style Sheets
    3. Handling Control Events
    4. Data Binding Controls
    5. Page Navigation
    6. Summary
  22. CHAPTER 14: Developing and Consuming Web Services
    1. What Are Services?
    2. WCF Web Services
    3. RESTful Data Services
    4. Summary
  23. CHAPTER 15: Developing the Office Supply Ordering Application
    1. Revisiting Application Design
    2. Building the OSO Application’s Data Access Layer
    3. Building the OSO Application’s Business Logic Layer
    4. Creating the OSO Application UI
    5. Summary
  24. CHAPTER 16: Wrapping Up
    1. Improve Your Object-Oriented Design Skills
    2. Investigate the .NET Framework Namespaces
    3. Become Familiar with ADO.NET and the Entity Framework
    4. Learn More about Creating Great User Interfaces (UI)
    5. Move toward Component-Based Development
    6. Find Help
    7. Join a User Group
    8. Please Provide Feedback
    9. Thank You, and Good Luck!
  25. APPENDIX A: Fundamental Programming Concepts
    1. Working with Variables and Data Types
    2. Understanding Elementary Data Types
    3. Introducing Composite Data Types
    4. Looking at Literals, Constants, and Enumerations
    5. Exploring Variable Scope
    6. Understanding Data Type Conversion
    7. Working with Operators
    8. Introducing Decision Structures
    9. Using Loop Structures
    10. Introducing Methods
  26. APPENDIX B: Exception Handling in C#
    1. Managing Exceptions
    2. Using the .NET Framework Exception Classes
    3. The Importance of Using
  27. APPENDIX C: Installing the Required Software
    1. Installing the Sample Databases
    2. Verifying the Database Installs
  28. Index