9.2. Design

In this book, we focus on the importing of text files only, but we want to design our application with the flexibility to support other file formats such as an Excel spreadsheet or an Outlook Personal File.

For the purpose of this chapter, we will create two implementations of this interface — one to handle an uploaded text file and another to handle a string of multiple contacts.

Multiple contacts will be entered in a multiline textbox as one contact per line with the contact details comma-delimited. For example:

user1@acme.com,firstname,lastname,male,12/17/1964

user2@hotmail.com,firstname

user3@gmail.com,,,female

We will also assume that the uploaded text file will be in the same format. Again, this is what we will support for now, but we have designed it in a way that will enable us to easily support other formats down the road.

Get ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.