Browse by Tags

All Tags » OOP » CSharp » .NET (RSS)
One of the new features in VB 10.0 is collection initializers. Collection initializers allow you to initialize an array or list in a single line of code. (C# has had collection initializers since C# 3.0. The examples here show both C# and VB for completeness...
6 comment(s)
Filed under: , , , , ,
Before going through the details of how to use object binding, it is important to understand exactly what it is—and what it is not. Object binding is binding your business object properties to user interface elements. Object binding is not database binding...
The four basic elements of an object-oriented system are abstraction , encapsulation , inheritance , and polymorphism . This post defines these terms and describes why they are important to software design and development. [To begin with an overview of...
5 comment(s)
Filed under: , , , ,
When talking about OO, the term “interface” has nothing to do with your user interface. An interface defines a list of properties and methods that a class can implement. But if the class implements a particular interface, it must implement all properties...
6 comment(s)
Filed under: , , , ,
In object-oriented (OO) terms, inheritance defines an “is a” relationship between two or more classes. A beagle is a dog, and a poodle is a dog, so both beagle and poodle inherit from dog. Both beagle and poodle have dog attributes and exhibit dog behaviors...
3 comment(s)
Filed under: , , , ,
Humans like to classify things, to find similarities in things, and to group them accordingly. Things with similar attributes ( properties ) and behaviors ( methods ) are grouped. In object-oriented terminology, the definition of the properties and methods...
2 comment(s)
Filed under: , , , ,
Objects are things. People, companies, employees, time sheets, and ledger entries are all types of objects. In object-oriented terms, the word object is used to describe one specific thing, such as Sam Smith the carpenter at 3322 Main Street and the May...
3 comment(s)
Filed under: , , , ,
Today’s world of software design and development is all about managing complexity. Computer-savvy users want more and more features. Software products, such as Microsoft Word and Excel, set high expectations. The business environment requires software...
6 comment(s)
Filed under: , , , ,
The specifics of this class demonstrate how to build an alarm. You can use this class to build an alarm clock application, or to add an alarm feature into your application, similar to the Reminder feature in Outlook. OR you can just use this class as...
5 comment(s)
Filed under: , , , ,
If you are building applications in .NET to manage data for a business, you are most likely creating business object classes. Depending on the business, these classes could include Customer, Product, Order, Invoice, PurchaseOrder, Employee, TimeCard and...
16 comment(s)
Filed under: , , , , , ,
A common requirement in most applications is to validate the data entered by the user. This is such a common requirement, that it makes sense to build a reusable Validation class. This post details the beginnings of a .NET Validation class. The class...
8 comment(s)
Filed under: , , , ,
Most business applications have business objects such as customer, order, or invoice. Often, the data access layer (DAL) provides the data and your code needs to use that data to manually populate a business object. This post describes how to manually...
2 comment(s)
Filed under: , , , , , ,
This entry details the implementation of the DateRange class from this example in C#: public class DateRange {     public DateTime StartDate { get; set; }     public DateTime EndDate { get; set; }     // Constructor...
with no comments
Filed under: , , ,
This entry details the implementation of the ZodiacSigns class from this example in C#: public class ZodiacSigns : List<ZodiacSign> { } Constructor The following is the constructor defined in the ZodiacSigns class: public ZodiacSigns() {    ...
with no comments
Filed under: , , , ,
This entry details the implementation of the ZodiacSign class from this example in C#: public class ZodiacSign {     // Properties     public string Name { get; set; }     public List<DateRange> DateRanges...
with no comments
Filed under: , , ,
Here is the story defining the simple use case for this application: The user picks a date between 2/19/1996 and 2/5/2019. The system displays the appropriate Chinese zodiac sign (Monkey, Dog, Rat, etc) Seems simple enough. So how to implement this …...
with no comments
Filed under: , , , ,
Someone on the MSDN forums recently asked how to apply object-oriented programming (OOP) principles to a basic game. So I thought it would be an interesting project to develop a very simple sample game using OOP. I selected MasterMind because it is a...
3 comment(s)
Filed under: , , , ,
Often times applications require lists of things: lists of customers, lists of experiments, lists of accounts and so on. The generic lists provided in .NET 2.0 made working with these lists easy. And the list initializers in C# and the object initializers...
10 comment(s)
Filed under: , , , , ,