Click here to Skip to main content
15,914,109 members
Home / Discussions / C#
   

C#

 
AnswerRe: windows communication foundation Pin
SeMartens19-Jan-09 1:21
SeMartens19-Jan-09 1:21 
Questionto retrieve the word document from sqlserver Pin
gopal_nivas8419-Jan-09 0:31
gopal_nivas8419-Jan-09 0:31 
AnswerRe: to retrieve the word document from sqlserver Pin
Giorgi Dalakishvili19-Jan-09 0:41
mentorGiorgi Dalakishvili19-Jan-09 0:41 
GeneralRe: to retrieve the word document from sqlserver Pin
gopal_nivas8419-Jan-09 0:48
gopal_nivas8419-Jan-09 0:48 
GeneralRe: to retrieve the word document from sqlserver Pin
Giorgi Dalakishvili19-Jan-09 0:50
mentorGiorgi Dalakishvili19-Jan-09 0:50 
QuestionCould you please tell me the advantage of using the interface to code? Pin
mctramp16819-Jan-09 0:16
mctramp16819-Jan-09 0:16 
AnswerRe: Could you please tell me the advantage of using the interface to code? Pin
SeMartens19-Jan-09 0:23
SeMartens19-Jan-09 0:23 
AnswerRe: Could you please tell me the advantage of using the interface to code? Pin
DaveyM6919-Jan-09 1:14
professionalDaveyM6919-Jan-09 1:14 
Interfaces are very useful - even though they don't do anything themselves.

A simple example. Imagine you needed to support more than one type of database, say XML and SQLServer. Obviously, you'd have a class for both types with the necessary methods. The methods exposed by each class would be identical - the only difference would be the implementation inside the methods.

This gives you three possibilities.
1. Have both classes exposed and call the correct one
2. Have an abstract base Database class that XML and SQLServer classes derrive from
3. Create an IDatabase Interface.

1 is not very flexible and would require the calling code to be closely coupled to your DB classes. If you later needed to add Oracle as an option, all your calling code would have to be changed.

2 is kind of pointless, as the base class would never actually be used.

3 gives the perfect solution. XML : IDatabse and SQLServer : IDatabase
Now you can call the methods on an IDatabase instance, and whether XML or SQLServer are called can be decided elsewhere - the calling code will never need to be changed and can be easily extended to support others in future.

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

AnswerRe: Could you please tell me the advantage of using the interface to code? Pin
Alan Balkany19-Jan-09 3:38
Alan Balkany19-Jan-09 3:38 
AnswerRe: Could you please tell me the advantage of using the interface to code? Pin
Guffa19-Jan-09 3:45
Guffa19-Jan-09 3:45 
AnswerRe: Could you please tell me the advantage of using the interface to code? Pin
CodingYoshi19-Jan-09 4:09
CodingYoshi19-Jan-09 4:09 
QuestionArrayList search Pin
kanchoette18-Jan-09 23:55
kanchoette18-Jan-09 23:55 
AnswerRe: ArrayList search Pin
SeMartens18-Jan-09 23:59
SeMartens18-Jan-09 23:59 
GeneralRe: ArrayList search Pin
CodingYoshi19-Jan-09 4:20
CodingYoshi19-Jan-09 4:20 
Questionmdi forms with parent and child interaction Pin
bfis10813718-Jan-09 23:38
bfis10813718-Jan-09 23:38 
AnswerRe: mdi forms with parent and child interaction Pin
harold aptroot18-Jan-09 23:44
harold aptroot18-Jan-09 23:44 
GeneralRe: mdi forms with parent and child interaction Pin
DaveyM6919-Jan-09 1:16
professionalDaveyM6919-Jan-09 1:16 
GeneralRe: mdi forms with parent and child interaction Pin
CodingYoshi19-Jan-09 4:16
CodingYoshi19-Jan-09 4:16 
Questionstrange Http timeout issue Pin
George_George18-Jan-09 23:11
George_George18-Jan-09 23:11 
QuestionHow to translate the property item name of the control in the properties window? Pin
mctramp16818-Jan-09 21:02
mctramp16818-Jan-09 21:02 
AnswerRe: How to translate the property item name of the control in the properties window? Pin
Eddy Vluggen18-Jan-09 22:02
professionalEddy Vluggen18-Jan-09 22:02 
GeneralRe: How to translate the property item name of the control in the properties window? Pin
mctramp16819-Jan-09 0:13
mctramp16819-Jan-09 0:13 
AnswerRe: How to translate the property item name of the control in the properties window? Pin
Eddy Vluggen19-Jan-09 1:28
professionalEddy Vluggen19-Jan-09 1:28 
GeneralRe: How to translate the property item name of the control in the properties window? Pin
mctramp16819-Jan-09 15:22
mctramp16819-Jan-09 15:22 
Questionhow to detect windowstate outside form? Pin
ping_jacob18-Jan-09 20:46
ping_jacob18-Jan-09 20:46 

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.