Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why Use Interfaces
Message
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01278205
Message ID:
01278239
Views:
23
I'm starting to get it.

OK, good. ;)

Like I said, the more frequently you work with it, the more you'll get it.


When is it appropriate for me to design an interface for a class?

You'll likely get 20 answers from 20 different people (with partial overlap)....let me answer this way...

1) As an interface is essentially a "contract" (focuses on the "what", as opposed to the guts of the "how"), think of any sitation where you build the TERMS of a contract.

2) You probably know that I develop a # of reporting apps. Most of the time I used stored procs to bring back data for the report. So the report and the proc will have input parameters (date range, user options, and selections) and then a result set (1 or more tables of resulting data). Obviously, if I define those 'terms' before I go build the actual proc and report, life will likely be a bit easier.

Additionally, a well-defined interface means you've taken a step towards building some unit tests.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform