Scott Dukes' Blog

Software Engineering, OOAD, Patterns, .NET, XHTML, CSS and more

Blogs I Read

Comments

dr_williamson said:

Well, Scott, it seems you are learning something!  :)  I do remember your original article, and I must confess that at the time I just rolled my eyes and continued about my business.

I’m glad to see that you’ve corrected one of the mistakes you made in your first article (which was unfortunately a premise upon which some of the remainder of your article was built) which was stating that “inheritance [using Abstract Base Classes...] means ‘is a’, whereas using an Interface means ‘behaves as ‘.”

Yes, inheritance does mean “is a”, but when you implement a class that derives from a pure abstract base class, you are in effect implementing the interface defined by your abstract base class, thereby implementing behaviour (i.e. “behaves as a”) rather than creating a DerivedClass that “is an” AbstractBaseClass. If you then derive from DerivedClass, then sure, DerivedDerivedClass “is a” DerivedClass, but DerivedClass “behaves like an” AbstractBaseClass.

So, in your new article, you are off to a good start under the heading “Abstract Classes Are Interfaces”. But I fear that your subsequent sections “So Which One Should I Use?” and “An Evolutionary Design Case Study” don’t do justice to the topic. That said, by the time you reach your conclusion you have grasped an important point, and that is you can mix interfaces and abstract base classes to arrive to your desired solution, without selling your soul to either one or the other.

There are a few more MSDN articles that make interesting reading if you’re interested in some more theory, such as this one:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconimplementinginterfacesincomponents.asp

Another interesting article can be found here:
http://java.sun.com/developer/JDCTechTips/2001/tt1106.html
(Scroll down about halfway to the heading “ABSTRACT CLASSES VS. INTERFACES”.)

I tend to use lots of concise interfaces (large, clunky interfaces are not likely to be widely used, are they?) but it is useful to remember that classes that derive from abstract base classes can still implement interfaces, and partial abstract classes can be particularly useful too. So, an abstract base class can help you achieve polymorphism... contractually!  :)   Deciding whether to use an interface or an abstract base class (or both!) is not as black and white as your first article implies.

A final comment… Your statement that “the initial requirement was to output ... to the console” was just screaming Caution: Scope Creep Ahead! So your later statement that “an additional requirement surfaced ... to generate the report in XML” surely should have been anticipated? Or maybe you were simplifying your case study for the benefit of a succinct explanation?

Yes, designs do “tend to change over time as new functionality is added to the system” but doesn’t that highlight what makes us stand out from the overcrowded sea of developer-wannabes? Being able to anticipate what direction the design might take? We don’t only program to interfaces - we also design concise, flexible, usable interfaces.

Thanks for an interesting read, Scott.

David R. Williamson
# July 10, 2006 10:17 PM

scott said:

Thanks David; I really appreciate the time you took to give really constructive feedback.

As you rightly guessed the case study was simplified for the benefit of a clear and concise (IMO) example. Looking back though it does seem a little trite and contrived but I hope it does the job.

As I mentioned earlier in the article, I tend to favour a Test Driven Development approach when developing, so though I often foresee the direction of change in a system (or application) I try not to implement anything until a legitimate need arises; YAGNI - You Ain't Gonna Need It - to quote varios XP texts.

That said the focus of this piece was on internal enterprise applications where interfaces are public but not published and thus hightly mutable. I feel that the same evolutionary approach still applies when developing published interfaces though they have to be transformed with greater care and caution.

I have been known to (gradually) implement large scale refactorings specifically to transform the interfaces in the system to be more extensible. All in all I totally agree with you comments specifically: We don’t only program to interfaces - we also design concise, flexible, usable interfaces.

An excellent point. Thanks again for the feedback.

Scott X Dukes
# July 12, 2006 8:39 PM

dvsehjhsjv said:

NHNfXw  <a href="vqkxlghngjzy.com/.../a>, [url=http://ultssgdbuqwd.com/]ultssgdbuqwd[/url], [link=http://wuksumyzwrwa.com/]wuksumyzwrwa[/link], http://nhqifsrxsuxq.com/

# May 19, 2008 3:22 AM

gaaaar said:

good site

http://bbhoster.org/monder/ top list blog

http://parentsbn.com/mondrid/ blog trends

# May 24, 2008 11:00 PM

zalupa said:

# May 25, 2008 12:55 AM

feldene said:

# May 25, 2008 5:14 PM

vicodin said:

forumup.eu/index.php buy vicodin online

# May 26, 2008 9:02 AM

ebony porn said:

# May 30, 2008 12:40 AM

feldene said:

# May 30, 2008 2:15 AM

<key> said:

doors.txt;5;9

# May 30, 2008 7:15 AM

<key> said:

doors.txt;5;9

# May 30, 2008 7:15 AM

nick said:

doors.txt;5;10

# May 31, 2008 8:23 AM

234asfd said:

# May 31, 2008 3:27 PM

buyfeldene said:

# June 4, 2008 3:28 PM

ebonycream said:

www.fotolog.com/.../about ebony free video

# June 4, 2008 6:12 PM

tatum said:

# June 10, 2008 9:01 AM

sdfafw34rt said:

23084ruweaoi code.google.com/.../BestXXXMovies best xxx movies

# June 12, 2008 2:53 AM

feldene said:

# June 18, 2008 7:11 AM

yafeldene said:

ya feldene www.google.com/.../preview buy feldene

# June 19, 2008 6:38 AM

rogaine said:

hello ya rogainko www.google.com/.../106392262582926865954 rogaine

paka

# June 20, 2008 8:50 AM

kinky said:

hy my name is kinky code.google.com/.../kinkymistress kinky mistress

# June 22, 2008 2:40 AM

buyrogaine said:

hellohoho www.otal.umd.edu/.../index.php buy rogaine

# June 22, 2008 4:05 AM

asgdhfj said:

dfshgb www.moreto.net/ads.php buy rogaine

# June 22, 2008 5:00 AM

onotole said:

suda www.google.com/.../104957548990908148169 ��������� � ����� ili suda code.google.com/.../besplatnoeporno ���������� �����

# June 24, 2008 9:36 AM

apil said:

comment4, egwhfwme.freehoxt.com/express-on-demand.htm express on demand,  6735, kxokaqiw.freehoxt.com/american-track-and-field.htm american track and field,  8-D, kxokaqiw.freehoxt.com/Mac-on-Chill-Menace-to-Society-Capone.htm Mac on Chill Menace to Society Capone,  8[[,

# June 26, 2008 10:50 AM

adult said:

# June 27, 2008 12:12 PM

a said:

# June 27, 2008 9:14 PM

b said:

# June 27, 2008 10:13 PM

c said:

# June 27, 2008 11:05 PM

d said:

# June 28, 2008 12:07 AM

e said:

# June 28, 2008 1:12 AM

jsewzlg said:

p8pafB  <a href="ipghxgebcpcn.com/.../a>, [url=http://meoyzqjomotx.com/]meoyzqjomotx[/url], [link=http://moayjglalrkn.com/]moayjglalrkn[/link], http://ceuylotrvrie.com/

# June 28, 2008 12:11 PM

mvevtymt said:

4ZpOYZ  <a href="ngzhoiqkoqfz.com/.../a>, [url=http://mbbasiqiduia.com/]mbbasiqiduia[/url], [link=http://jsclemactydp.com/]jsclemactydp[/link], http://iaownpqleipy.com/

# July 19, 2008 3:59 AM

puszjkbyz said:

XxBGUX  <a href="nnvyrcorhbrb.com/.../a>, [url=http://qnzirtoednbi.com/]qnzirtoednbi[/url], [link=http://qgqkzoqsdggj.com/]qgqkzoqsdggj[/link], http://ycooytlucuwo.com/

# July 19, 2008 3:59 AM

gdlwrkmyijd said:

r9VX6A  <a href="ypzkmerkhwht.com/.../a>, [url=http://kgcqteiihjlh.com/]kgcqteiihjlh[/url], [link=http://mdrkvkftbnzr.com/]mdrkvkftbnzr[/link], http://okmitdzrhnbj.com/

# July 22, 2008 9:57 AM

pqmcbejsu said:

ifRrWX  <a href="vawxuqcabktp.com/.../a>, [url=http://msxsasemehxr.com/]msxsasemehxr[/url], [link=http://bhxirkreqofd.com/]bhxirkreqofd[/link], http://umjtdffpnlke.com/

# July 22, 2008 10:14 AM

sdjfbh said:

cs www.google.com/.../preview jessica simpson gallery gvds www.google.com/.../preview angelina jolie naked ijnsd www.google.com/.../preview angelina jolie gallery

# July 22, 2008 11:32 PM

warsgd said:

nuer www.google.com/.../preview ashlee simpson lyrics nuvoq www.google.com/.../preview hilary duff naked

# July 23, 2008 2:37 AM

rbwkdwgz said:

kL5ylR  <a href="hvivgnwhjoip.com/.../a>, [url=http://upxiqkupfali.com/]upxiqkupfali[/url], [link=http://iryqkvftupck.com/]iryqkvftupck[/link], http://icrskzaokajm.com/

# July 23, 2008 4:02 AM

kgjvxporc said:

p70zNH  <a href="mmsmmgvileqz.com/.../a>, [url=http://jmelhfuguroo.com/]jmelhfuguroo[/url], [link=http://lqxsdljybowq.com/]lqxsdljybowq[/link], http://zaxvhgsbnufy.com/

# July 23, 2008 4:02 AM

Dimitri said:

Nice article…, honeymoon.raiselight.com/index.html more info,  05509,

# July 23, 2008 12:19 PM

Dighenis said:

Great site, solar.df-host.com/.../cheats-codes-for-playstation-2-game-godz.html cheats codes for playstation 2 game godz,  :-]],

# July 23, 2008 1:47 PM

Dimitrios said:

Nice article…, forummy.co.cc/.../last-minute-orlando-travel-deals.html last minute orlando travel deals,  %DDD,

# July 23, 2008 4:51 PM

Dimitrios said:

Regards and best wishes, soundtracks.bestwap.us/.../soundtrack-feuer-und-eis.html soundtrack feuer und eis,  %-),

# July 23, 2008 6:24 PM

Dimitri said:

excellent resource, forummy.co.cc/.../mount-airy-lodge-poconos.html mount airy lodge poconos,  tnju,

# July 24, 2008 12:37 AM

Dimitri said:

Regards and best wishes, solar.df-host.com/.../game-cheats-paper-mario.html game cheats paper mario,  >:(((,

# July 24, 2008 3:43 AM

Hurricane Dolly said:

# July 24, 2008 5:16 AM

Dimitrios said:

Nice article…, chadmiller.hostedwith.us/avatar5092.html more info,  =PPP,

# July 25, 2008 2:46 AM

fofluke said:

# July 27, 2008 5:17 AM

nailtek said:

# July 27, 2008 8:17 AM

prefabbr said:

sdf guasa.ya.com/prefabbricate prefabbricate

# July 27, 2008 9:14 AM

davboot said:

lijbdfv abaco.ya.com/davidsonboots davidson boots

# July 27, 2008 11:13 AM

solar heating here said:

# July 29, 2008 11:42 AM

Dighenis said:

excellent resource, generic-zyrtec.thecatchy.com/index.html read here,  :OO,

# July 29, 2008 2:41 PM

Demosthenes said:

Regards and best wishes, weddi.4qh.info/.../index.html more info,  8OOO,

# July 29, 2008 4:00 PM

Dighenis said:

Great site, ostin.site-4-free.com/.../index.html more info,  %-O,

# July 29, 2008 5:18 PM

Demosthenes said:

Great site, weddi.4qh.info/.../index.html read here,  kkdj,

# July 29, 2008 6:38 PM

Dimitrios said:

Interesting, zbest.auctionlisterpro.net/.../index.html look here,  acj,

# July 29, 2008 8:01 PM

Dimitrios said:

Nice article…, buy-french-wines-online.thecatchy.com/index.html buy online wines,  478594,

# July 29, 2008 9:26 PM

Dimitri said:

excellent resource, zbest.auctionlisterpro.net/.../index.html more info,  80426,

# July 30, 2008 1:46 AM

Dimitri said:

Nice article…, weddi.4qh.info/.../index.html read here,  019,

# July 30, 2008 3:17 AM

Dighenis said:

excellent resource, dezai.co.cc/.../index.html blow the breaks torrent,  34141,

# July 30, 2008 4:49 AM

Dimitri said:

Nice article…, zbest.auctionlisterpro.net/.../index.html dept of education student loans,  =-)),

# July 30, 2008 6:21 AM

Dimitrios said:

Hi, weddi.4qh.info/.../index.html read here,  >:-[[,

# July 30, 2008 7:56 AM

gaydar said:

# July 30, 2008 9:25 AM

sleazy dream said:

# July 30, 2008 12:22 PM

Dighenis said:

excellent resource, mad-thumbs.bestuseful.com/mad-thumbs-vids.html mad thumbs vids,  xgfkl,

# July 30, 2008 3:04 PM

ashleesympson said:

# July 31, 2008 10:04 PM

Bridal Consultant said:

# August 1, 2008 1:08 PM

Mystery Shopping said:

# August 1, 2008 2:31 PM

Financial Advisor said:

financial-advisor.greatuseful.com Financial Advisor Career

# August 1, 2008 3:53 PM

Federal Employment Online said:

# August 1, 2008 5:10 PM

Beijing 2008 said:

# August 1, 2008 6:31 PM

olympic site said:

# August 1, 2008 7:36 PM

olympics 2008 said:

# August 1, 2008 8:44 PM

Olympics Mascots said:

# August 1, 2008 9:55 PM

Dimitrios said:

Nice article…, dezai.ash8.com/.../index.html more info,  iphz,

# August 1, 2008 11:04 PM

jhdsfg said:

# August 2, 2008 12:47 AM

jrhe said:

# August 2, 2008 1:37 AM

kjdstfh said:

# August 2, 2008 2:24 AM

Dimitrios said:

# August 2, 2008 2:29 AM

kdfjgf said:

# August 2, 2008 3:08 AM

Dimitrios said:

excellent resource, cizoxpmd.012webpages.com/.../index.html read here,  :)),

# August 2, 2008 4:48 AM

Dimitrios said:

Nice article…, dezai.ash8.com/.../index.html read here,  %-]],

# August 2, 2008 5:55 AM

Chamber Rental said:

# August 2, 2008 7:01 AM

Doll Clothes said:

# August 2, 2008 8:28 AM

Ringtones said:

# August 2, 2008 9:50 AM

Remodeling said:

# August 2, 2008 11:12 AM