Click here to Skip to main content
15,888,242 members
Home / Discussions / C#
   

C#

 
GeneralHelp me finish this solution Pin
Anonymous12-Feb-04 19:30
Anonymous12-Feb-04 19:30 
GeneralRe: Help me finish this solution Pin
Heath Stewart13-Feb-04 3:42
protectorHeath Stewart13-Feb-04 3:42 
GeneralUsing Interfaces Practically Pin
Anonymous12-Feb-04 19:20
Anonymous12-Feb-04 19:20 
GeneralRe: Using Interfaces Practically Pin
Mazdak12-Feb-04 19:27
Mazdak12-Feb-04 19:27 
GeneralRe: Using Interfaces Practically Pin
Anonymous13-Feb-04 15:56
Anonymous13-Feb-04 15:56 
GeneralRe: Using Interfaces Practically Pin
Nick Seng12-Feb-04 21:44
Nick Seng12-Feb-04 21:44 
GeneralRe: Using Interfaces Practically Pin
Brian Delahunty13-Feb-04 0:48
Brian Delahunty13-Feb-04 0:48 
GeneralRe: Using Interfaces Practically Pin
Jonathan de Halleux13-Feb-04 2:39
Jonathan de Halleux13-Feb-04 2:39 
- Interfaces lets you make multiple inherance.

The best examples are IList,ICollection,IEnumerate from the System.Collections namespace.

- Interfaces makes you focus on design before starting to actually do any coding. Ok, an example.

Consider you need to develop a product that manages customers, products and orders (classic example). Note that when starting to design the product, you do not know "implementation" details like how the data will be stored, etc...

The problem is sufficiently simple we don't have to go through UML and stuff but we can use interfaces to defines the relationships between the objects
public interface ICustomer
{
   string Name {get;}   
}

public interface IProduct
{
   string Name {get;}
}

public interface IOrder
{
   ICustomer Customer {get;}
   IProduct Product {get;}
   int Quantity {get;}
}


Here you can see the relationships between ICustomer, IProduct and IOrder. It is important to note that you have not written any "line of code" yet. You have just defined the objects. After that, you can implement the interface for database data, XMl file etc...

:=)

Jonathan de Halleux.

www.dotnetwiki.org
GeneralRe: Using Interfaces Practically Pin
paw197213-Feb-04 5:33
paw197213-Feb-04 5:33 
GeneralMaking Variables In C# Global Pin
Eric Houser12-Feb-04 18:44
Eric Houser12-Feb-04 18:44 
GeneralRe: Making Variables In C# Global Pin
John Kuhn12-Feb-04 18:49
John Kuhn12-Feb-04 18:49 
GeneralRe: Making Variables In C# Global Pin
Eric Houser12-Feb-04 18:54
Eric Houser12-Feb-04 18:54 
GeneralRe: Making Variables In C# Global Pin
John Kuhn12-Feb-04 19:07
John Kuhn12-Feb-04 19:07 
GeneralRe: Making Variables In C# Global Pin
John Kuhn12-Feb-04 18:52
John Kuhn12-Feb-04 18:52 
GeneralRe: Making Variables In C# Global Pin
Meysam Mahfouzi12-Feb-04 18:59
Meysam Mahfouzi12-Feb-04 18:59 
GeneralRe: Making Variables In C# Global Pin
Eric Houser12-Feb-04 19:07
Eric Houser12-Feb-04 19:07 
GeneralArabic to roman Pin
GetOn&GetGoing12-Feb-04 18:30
GetOn&GetGoing12-Feb-04 18:30 
GeneralRe: Arabic to roman Pin
John Kuhn12-Feb-04 18:46
John Kuhn12-Feb-04 18:46 
GeneralRe: Arabic to roman Pin
GetOn&GetGoing12-Feb-04 18:50
GetOn&GetGoing12-Feb-04 18:50 
GeneralRe: Arabic to roman Pin
John Kuhn12-Feb-04 18:57
John Kuhn12-Feb-04 18:57 
GeneralRe: Arabic to roman Pin
GetOn&GetGoing12-Feb-04 19:08
GetOn&GetGoing12-Feb-04 19:08 
GeneralRe: Arabic to roman Pin
John Kuhn12-Feb-04 19:18
John Kuhn12-Feb-04 19:18 
GeneralInterview Pin
GetOn&GetGoing12-Feb-04 17:41
GetOn&GetGoing12-Feb-04 17:41 
GeneralRe: Interview Pin
John Kuhn12-Feb-04 18:13
John Kuhn12-Feb-04 18:13 
GeneralRe: Interview Pin
CWIZO13-Feb-04 0:30
CWIZO13-Feb-04 0:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.