Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Architecture
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
Bing
BizTalk
Book Excerpts
Build and Deploy
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Design Patterns
Development Process
Display Technologies
Distributed Computing
DotNetNuke
DSL
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
Internet Explorer 8.0
Interviews
iPhone
Iron Ruby
Java
Java Script
jQuery
LINQ
Linux
Mac OS X
MDX
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
Network
NHibernate
Object Oriented Development
Odata
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Python
Q&A
Rails
Rake
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Search
Security
Services
SharePoint
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
Tips
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WF
Whitepapers
Windows 7
Windows Azure
Windows Live
Windows Server
Windows Vista
WinForms
Workflow
WPF
XAML
XML
XNA
XSLT



INSTANTLY dtSearch® TERABYTES OF TEXT


 


DevReach

Reader rating:
Click here to read 2 comments about this article.
Article source: CoDe (2005 - May/Jun)


Article Pages:  1  2 3 4 - Next >


Inheritance 101

Extend your knowledge of inheritance to more easily extend your applications.

Visual Basic developers had wanted inheritance for what seems like decades. The feature finally made it into VB.NET, making VB.NET an official object-oriented language. By now you are probably already using inheritance in your applications, but are you fully taking advantage of its potential?

"
Inheritance is an abstraction for sharing similarities among classes while preserving their differences.
"

As a consultant, I am frequently called into companies to perform code reviews of VB.NET and C# code. I truly enjoy this process because I have the benefit of seeing all of the many ways that applications can be architected and implemented. In going through the code, I have seen great use, and abuse, of inheritance in .NET applications.

This article reviews what inheritance is, when and how to use it, and tips for getting the greatest benefit from this valuable feature.

Sharing Similarities

Inheritance is an abstraction for sharing similarities among classes while preserving their differences. It is easiest to fully grasp inheritance by way of an example.

This example is a simple simulation that is loosely based on "WA-TOR", which was first introduced in a famous Scientific American magazine article by A. K. Dewdney. WA-TOR is a planet composed entirely of an ocean. It is shaped like a donut (the technical term for which is "toroid" - if you are into video games, think Halo).

Though it is shown on a two-dimensional grid (see Figure 1) the movement is such that if something moves up off the top it shows up at the bottom, if it moves right off the edge it shows up on the left edge, and so on.

Click for a larger version of this image.

Figure 1: The WA-TOR simulation shows the movement of fish and sharks in a toroidal ocean.

This simulation was recently presented as part of the MSDN "Object-Oriented Programming in .NET" event (http://www.msdnevents.com/). The code for the simulation is available at: www.microsoft.com/dcc.

As with any object-oriented application, start by thinking about the entities or objects involved with the application. For example, this simulation application has an Ocean entity that represents the ocean space. This is represented with an Ocean class that manages a two-dimensional grid:

Public Class Ocean
   Private myCell(0, 0) As Object
   Public Function getObject(ByVal As Point) _
                                   As Object
      Return myCell(p.x, p.y)
   End Function

   Public Sub putObject(ByVal thing As Object)
     myCell(thing.Location.x, thing.Location.y)= _
                                     thing
   End Sub
   . . .
End Class
&

By: Deborah Kurata

Deborah Kurata is cofounder of InStep Technologies Inc., a professional consulting firm that focuses on turning your business vision into reality using Microsoft .NET technologies. She has over 15 years of experience in architecting, designing and developing successful applications.

Deborah is the author of several books, including Best Kept Secrets in .NET (Apress), Doing Objects in Visual Basic 6.0 (SAMS) and Doing Web Development: Client-Side Techniques (Apress). She is on the INETA Speaker’s Bureau, is a well-known speaker at technical conferences, and is a Microsoft Most Valuable Professional (MVP). After a hard day of coding and taking care of her family, Deborah enjoys blowing stuff up (on her XBox of course).

Some of the information in this article was obtained from her upcoming book, Doing Objects in VB 2005.

deborahk@insteptech.com

Fast Facts

Inheritance allows us to think about our applications in a way that makes them easier to extend over time. This is key as more development teams are moving to an agile approach to iterative software development.



Article Pages:  1  2 3 4 - Next Page: 'Inheritance 101 (con't).' >>

Page 1: Inheritance 101
Page 2: Inheritance 101 (con't).
Page 3: I Want My Inheritance
Page 4: Inheritance In Reality

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
1.8 out of 5

14 people have rated this article.

      INSTANTLY dtSearch® TERABYTES OF TEXT

 

INSTANTLY dtSearch® TERABYTES OF TEXT