Beginning C# Object-Oriented Programming 2nd Ed

Author: Dan Clark
Publisher: Apress
Pages: 384
ISBN: 978-1430249351
Audience: UML Beginners
Rating: 3
Reviewer: Ian Elliot

 

Does this book introduce object-oriented ideas using C# or does it introduce C# using object-oriented methods?

If you are a C# beginner and are hoping to learn C# in good object oriented style then this is not the book for you. It is not an introduction to C# even though the title suggests it is. In fact you need to be fairly secure in your knowledge of C# to get much from this book at all. 

What it is about is the big idea behind the object-oriented method and C# is almost an incidental player in the narrative - although some later chapters to spend a lot of time on .NET specific technologies. 

 

Banner

 

The first four chapters constitute a fairly standard introduction to object oriented ideas including a bit emphasis on UML. If you already know some of this then there is nothing new to find here and why should there be in an introduction. Each chapter has practical examples that you are supposed to complete to get the full value from the book. It makes use of UMLet to create diagrams but you might miss this fact if you don't read the introduction or look at the appendix on software. The case study is a simple e-commerce site with objects to represent customers and orders. 

Chapter 5 is where the C# begins with a look at the .NET Framework and Visual Studio. To be honest if you need to read this chapter you are not going to make much progress with the rest of the book.

Chapter 6 starts the look at how objects are implemented in real languages using C# as its example. This introduces the idea of a class and details such as the constructor, instances and overloading. Chapter 7 moves on to the bigger picture - creating class hierarchies. This is about inheritance and how to use it. The problem is that while many of the ideas are illustrated with C# code very little of the C# is actually explained.

For example, on page 105 we have a section on calling a derived class method within a base class. It is an interesting example, but you are left to work out what is going on in the code example. The discussion for some reason picks up on the use of "this" and says it isn't really necessary when the important thing is actually the use of virtual in the method definitions. In fact, rather than explaining this special use case, why not explain the distinction between virtual and non-virtual methods? Then the special case becomes all too obvious. This is a pattern that is repeated throughout the book, which basically just presents ideas that are well explained just about everywhere. 

Chapter 8 deals with "Object Collaboration", which basically is a look at how objects work together. Topics include messaging and events. Rather than explain how delegates work, i.e. they are object wrappers for functions, the book goes into ideas of delegation in a service architecture. Then it gets into the details of C# event handling.The next topic covered is exception handling. This is made to sound like event handling for when things go wrong. No attempt is made to explain the difference between an exception and the need to handle conditions which you might reasonably expect to occur. The point is that an exception isn't just a use condition that you just decide to handle by throwing an exception - it should be something genuinely exceptional and difficult to predict and handle. The chapter finishes with a look at static methods and asynchronous methods which gives it a feeling of just being a disconnected list of topics. 

 

 

Chapter 9 marks the part of the book that moves more into C# than objects. It describes working with collections, which is more a benefit of object-oriented working than a core idea.

Chapter 10 introduces ADO.NET and then progresses to the Entity Framework and Linq. Chapter 11 is about WPF applications and it hardly has anything to do with object-oriented ideas - it is just a tutorial on using WPF. The same is more-or-less true of chapter 12 on developing web applications i.e. ASP.NET using classic web forms - no mention of MVC. Chapter 13 deals with Windows Store Apps and it just seems to be another tutorial tacked on to keep the book up-to-date. Chapter 14 explains WCF and REST web services 

Chapter 15 brings the book together in a final example of an office supply ordering application and Chapter 16 introduces lot of ideas that didn't fit anywhere else and provides a gentle encouragement to learn more about object-oriented programming in C#.

This is three different books under one cover. The first is a short introduction to UML and activity diagrams. The second is a short introduction to object-oriented ideas as implemented in C# and the third is a look at a set of .NET technologies that just happen to be implemented using object-oriented methods.

Of the three the first probably works the best. If you don't know anything about UML and related technologies then you might find it a useful summary. The big failure is the part on C# object-oriented facilities where the opportunity to explain big ideas is missed and what you gets is a collection of topics patched together to follow the usual encapsulation, inheritance and polymorphism story. The final part on the various .NET technologies is simply off topic.

 

Banner


Practices of the Python Pro

Author: Dane Hillard
Publisher: Manning
Date: January 2020
Pages: 248
ISBN: 978-1617296086
Print: 1617296082
Audience: Python developers
Rating: 3
Reviewer: Mike James
I want to be a Python Pro....



Python Programming with Design Patterns

Author: James W. Cooper
Publisher: Addison-Wesley
Date: February 2022
Pages: 352
ISBN: 978-0137579938
Print: 0137579934
Kindle: B09D2RKQB5
Audience: Python developers
Rating: 1
Reviewer: Mike James
There was a time that design patterns were all the thing. Not so much now. But Python - does it have [ ... ]


More Reviews

 

 

Last Updated ( Wednesday, 12 March 2014 )