Skip to content

Instantly share code, notes, and snippets.

@kosperera
Created August 16, 2012 13:53
Show Gist options
  • Save kosperera/bbf5c6c3a8f8441d9a3e to your computer and use it in GitHub Desktop.
Save kosperera/bbf5c6c3a8f8441d9a3e to your computer and use it in GitHub Desktop.
Blogged: Don't ask for anything - Code snippet 3
public class Document
{
private readonly Content html;
public Document(Content content)
{
html = content;
}
}
public class DocumentFactory
{
private readonly HtmlClient client;
public DocumentFactory(HtmlClient c)
{
client = c;
}
Document Build(string url)
{
return new Document(client.GetContent(url));
}
}
public class Printer
{
public void Print(Document content)
{
// HACK: Printing logic goes here.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment