Question about interfaces in C# -


here question...

i work in telecom industry , have piece of software provides best network available given service number or site installation address. company uses network of wholesale provider , have our own network well. assess services customer might able get, call webservice find out services available on given telephone exchange , based on services available, need run checks against either our network or network of wholesale provider.

my question how can modelled using interfaces in c#? software have not make use of interfaces , whatever classes there satisfy fact code cannot live outside classes.

i familiar concept of interfaces, @ least on theoretical level, not familiar concept of programming interfaces.

what thinking along following lines:

create interface called iservicequalification have operation defined : void qualify(). have 2 classes called qualifybynumber , qualifybyaddress , both of these implement interface , define details of operation qualify. thinking along right lines or there different/better way of approaching issue.

i have read few examples of programming interfaces, see utilized in work situation.

comments/suggestions welcome.

i make go little bit deeper, on right track. create iservicequalification qualify method , below abstract class called servicequalification have abstract method called qualify kind of qualifier class implement. lets define common behavior among qualifiers (there bound some) while still creating separation of concerns @ high level.

interfaces have defined purpose , using them lets implement in way want without having code require implementation. so, can create service looks like:

public bool shouldqualify(iservicequalification qualification) 

and no matter implementation send it, method work. becomes never have change or modify once working. additionally, leads directly bugs. if reports qualifications address aren't working, know look.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -