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.
Author(s): Dan Clark
Edition: 2
Publisher: Apress
Year: 2013
Language: English
Pages: 360
Beginning C# Object-Oriented Programming
Contents at a Glance
Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Overview of Object-Oriented Programming
What is OOP?
The History of OOP
Why Use OOP?
The Characteristics of OOP
Objects
Abstraction
Encapsulation
Polymorphism
Inheritance
Aggregation
The History of C#
Summary
Chapter 2: Designing OOP Solutions: Identifying the Class Structure
Goals of Software Design
Understanding the Unified Modeling Language
Developing a SRS
Introducing Use Cases
Understanding Class Diagrams
Modeling Object Relationships
Association
Inheritance
Aggregation
Association Classes
Summary
Chapter 3: Designing OOP Solutions: Modeling the Object Interaction
Understanding Scenarios
Introducing Sequence Diagrams
Message Types
Recursive Messages
Message Iteration
Message Constraints
Message Branching
Understanding Activity Diagrams
Decision Points and Guard Conditions
Parallel Processing
Activity Ownership
Exploring GUI Design
GUI Activity Diagrams
Interface Prototyping
Interface Flow Diagrams
Application Prototyping
Summary
Chapter 4: Designing OOP Solutions: A Case Study
Developing an OOP Solution
Creating the System Requirement Specification
Developing the Use Cases
Diagramming the Use Cases
Developing the Class Model
Identifying the Classes
Adding Attributes to the Classes
Identifying Class Associations
Modeling the Class Behaviors
Developing the User Interface Model Design
Avoiding Some Common OOP Design Pitfalls
Summary
Chapter 5: Introducing the .NET Framework and Visual Studio
Introducing the .NET Framework
Goals of the .NET Framework
Support of Industry Standards
Extensibility
Unified Programming Models
Easier Deployment
Improved Memory Management
Improved Security Model
Components of the .NET Framework
Common Language Runtime
Framework Base Class Library
Data Classes
Windows Applications
Web Applications
Windows Store Applications
Application Services
Working with the .NET Framework
Understanding Assemblies and Manifests
Referencing Assemblies and Namespaces
Compiling and Executing Managed Code
Using the Visual Studio Integrated Development Environment
Summary
Chapter 6: Creating Classes
Introducing Objects and Classes
Defining Classes
Creating Class Properties
Creating Class Methods
Using Constructors
Overloading Methods
Summary
Chapter 7: Creating Class Hierarchies
Understanding Inheritance
Creating Base and Derived Classes
Creating a Sealed Class
Creating an Abstract Class
Using Access Modifiers in Base Classes
Overriding the Methods of a Base Class
Calling a Derived Class Method from a Base Class
Calling a Base Class Method from a Derived Class
Overloading Methods of a Base Class
Hiding Base Class Methods
Implementing Interfaces
Understanding Polymorphism
Summary
Chapter 8: Implementing Object Collaboration
Communicating Through Messaging
Defining Method Signatures
Passing Parameters
Understanding Event-Driven Programming
Understanding Delegation
Implementing Events
Responding To Events
Windows Control Event Handling
Handling Exceptions in the .NET Framework
Using the Try-Catch Block
Adding a Finally Block
Throwing Exceptions
Nesting Exception Handling
Static Properties and Methods
Using Asynchronous Messaging
Summary
Chapter 9: Working with Collections
Introducing the .NET Framework Collection Types
Working with Arrays and Array Lists
Using Generic Collections
Programming with Stacks and Queues
Summary
Chapter 10: Implementing the Data Access Layer
Introducing ADO.NET
Working with Data Providers
Establishing a Connection
Executing a Command
Using Stored Procedures
Using the DataReader Object to Retrieve Data
Using the DataAdapter to Retrieve Data
Working with DataTables and DataSets
Populating a DataTable from a SQL Server Database
Populating a DataSet from a SQL Server Database
Establishing Relationships between Tables in a DataSet
Editing Data in the DataSet
Working with the Entity Framework
Querying Entities with LINQ to EF
Updating Entities with the Entity Framework
Summary
Chapter 11: Developing WPF Applications
Windows Fundamentals
Introducing XAML
Using Layout Controls
Adding Display Controls
Using the Visual Studio Designer
Handling Control Events
Creating and Using Dialog Boxes
Presenting a MessageBox to the User
Creating a Custom Dialog Box
Data Binding in Windows-Based GUIs
Binding Controls Using a DataContext
Creating and Using Control and Data Templates
Summary
Chapter 12: Developing Web Applications
Web Pages and Web Forms
Web Server Control Fundamentals
Understanding Web Page and Web Server Control Inheritance Hierarchy
Using the Visual Studio Web Page Designer
The Web Page Life Cycle
Control Events
Understanding Application and Session Events
Creating Server-Side Control Event Handlers
Storing and Sharing State in a Web Application
Maintaining View State
Using Query Strings
Using Cookies
Maintaining Session and Application State
Data-Bound Web Controls
Model Binding
Summary
Chapter 13: Developing Windows Store Applications
Building the User Interface
Using Style Sheets
Handling Control Events
Data Binding Controls
Page Navigation
Summary
Chapter 14: Developing and Consuming Web Services
What Are Services?
WCF Web Services
Creating a WCF Web Service
Consuming a WCF Web Service
Using Data Contracts
RESTful Data Services
Creating an ASP.NET Web API Service
Consuming ASP.NET Web API Services
Summary
Chapter 15: Developing the Office Supply Ordering Application
Revisiting Application Design
Building the OSO Application’s Data Access Layer
Building the OSO Application’s Business Logic Layer
Creating the OSO Application UI
Summary
Chapter 16: Wrapping Up
Improve Your Object-Oriented Design Skills
Investigate the .NET Framework Namespaces
Become Familiar with ADO.NET and the Entity Framework
Learn More about Creating Great User Interfaces (UI)
Move toward Component-Based Development
Find Help
Join a User Group
Please Provide Feedback
Thank You, and Good Luck!
Appendix A: Fundamental Programming Concepts
Working with Variables and Data Types
Understanding Elementary Data Types
Integral Data Types
Non-Integral Data Types
Character Data Types
Boolean Data Type
Date Data Type
Object Data Type
Nullable Types
Introducing Composite Data Types
Structures
Arrays
Classes
Looking at Literals, Constants, and Enumerations
Literals
Constants
Enumerations
Exploring Variable Scope
Block-Level Scope
Procedure Scope
Module Scope
Understanding Data Type Conversion
Implicit Conversion
Explicit Conversion
Widening and Narrowing Conversions
Working with Operators
Arithmetic Operators
Comparison Operators
Logical Operators
Ternary Operator
Introducing Decision Structures
If Statements
Switch Statements
Using Loop Structures
While Statement
Do-While Statement
For Statement
For Each Statement
Introducing Methods
Appendix B: Exception Handling in C#
Managing Exceptions
Using the .NET Framework Exception Classes
The Importance of Using
Appendix C: Installing the Required Software
Installing the Sample Databases
Verifying the Database Installs
Index