Here are some basics to help you get started. =)
- .Net Naming Conventions and Programming Standards and Best Practices;
- Object-Oriented Concepts;
- Object-oriented design;
- C# Coding Style Guide;
- File Organization
- Code Convention C#;
- Design Guidelines for Class Library Developers;
The architecture of your solution might look like this:
- One project for your classes (One class per file);
- One project for your data access;
- One project for your GUI;
- One project for your integration layer (Such as NHibernate, EntityFramework, etc.)
Bear in mind that you must make each piece of code as reusable as possible. Doing so by writing your business objects (your classes) into an independant project will allow you to reference this project into another one later on, so you won't have to recode all of your business logic (methods, etc.) and your business objects (classes, enumerations, interfaces, etc.)
The object-oriented design is trying to generalize every practical aspect of an object and bringing it to the top most general class for your business objects. For instance:
// File: Person.cs
public class Person {
public string Name { get; set; }
public string Number { get; set; }
// Some other general properties...
}
// File: Customer.cs
public class Customer : Person {
public Customer() {
Orders = new List<Order>();
}
public string CreditTerm { get; set; }
public IList<Order> Orders { get; }
}
// File: Contact.cs
public class Contact : Person {
public long PhoneNumber { get; set; }
public long FaxNumber { get; set; }
}
// File: Supplier.cs
public class Supplier : Person {
public Supplier() {
Salesperson = new Contact();
}
public Contact Salesperson { get; }
}
It is also recommended to specify what each of your projects stand for. Let's take for instance an application for Customer Management:
MyCompany.MyCustomerMgmtSoftware.Domain <= This project shall contain your business classes definitions
MyCompany.MyCustomerMgmtSoftware.Data <= This project shall contain classes for data accessing your DBRM.
MyCompany.MyCustomerMgmtSoftware <= This project normally contain your GUI
MyCompany.MyCustomerMgmtsoftware.Mappings <= This project should contain your mapping files (while using NHibernate, for instance.
Does this help?