Main

type

5 (blog/news article)

status

21 (imported old-v2, waiting for another import)

review version

0

cleanup version

0

pending deletion

0 (-)

created at

2025-12-04 05:45:36

updated at

2025-12-04 05:45:37

Address

url

https://matt.berther.io/2004/07/10/design-patterns-template-method/

url length

67

url crc

54376

url crc32

4273722472

location type

1 (url matches target location, page_location is empty)

canonical status

10 (verified canonical url)

canonical page id

3080217051

Source

domain id

297007399

domain tld

86

domain parts

0

originating warc id

-

originating url

https://data.commoncrawl.org/crawl-data/CC-MAIN-2025-33/segments/1754151279901.12/warc/CC-MAIN-20250806074443-20250806104443-00690.warc.gz

source type

11 (CommonCrawl)

Server response

server ip

18.67.76.87

Publication date

2025-08-06 09:39:36

Fetch attempts

0

Original html size

18768

Normalized and saved size

16106

Content

title

Design Patterns: Template Method

excerpt

content

Let’s take a look at how we can refactor an existing chunk of code to take advantage of the Template Method design pattern. This pattern’s intent is to provide a skeleton of an algorithm in a method, deferring some steps to subclasses. Our original chunk of code will come from Michael Schwarz’s post about using IHttpHandlers without IIS settings. Just to be clear, this article intends no disrespect to Mr. Schwarz’s post or code quality. He has a perfectly acceptable solution to the problem. I just want to show how design patterns can be used to simplify the solution. As you look through the code, you can see that the base class exposes a Render event that subclasses need to use to inject their own painting prior to being written to the output stream. Every subclass needs to remember to wire this event up if they wish to use it. Picking out the template method is fairly simple in this case. Since we want our subclasses to be able to paint onto the graphics object, our base c...

author

updated

2025-12-26 09:50:48

Text analysis

block type

0

extracted fields

233

extracted bits

featured image
title
full content
content was extracted heuristically
OpenGraph suggests this is an article

detected location

0

detected language

1 (English)

category id

Other [en] (231)

index version

2025123101

paywall score

0

spam phrases

0

Text statistics

text nonlatin

0

text cyrillic

0

text characters

2214

text words

449

text unique words

224

text lines

1

text sentences

20

text paragraphs

1

text words per sentence

22

text matched phrases

0

text matched dictionaries

0