- Table of contents
- Introduction
- Requirements’ checklist
- Design considerations
- User guide
- Developer guide
- Testing
- Reflections on programming language and implementation
- Conclusion
ntm
- Sending HTTP request messages
- Receiving HTTP response messages
- Display received HTML
- Display received HTTP response status code (code and status)
- Reload current page
- Home page
- Create home page URL
- Edit home page URL
- Home page URL persisted
- Favourites
- Add a favorite (composed of a name and an URL)
- Delete favourites
- Modify favourites
- Request a favorite by click
- Favourites persisted
- History
- Next and previous pages navigation
- Jump to page by click
- History persisted
- GUI
- Buttons
- Shortcuts
To the best of my knowledge, no requirement was overlooked.
I opted for a structure based on the MVP pattern, as it seemed quited practical in the context of a WinForm application. I also looked into the MVC and MVVM patterns, but the former seemed rather unadapted to WinForms while the latter seem too complex for a project with only four model sources.
Indeed, I indentified the three model sources as the homepage URL, the favourites, the history and the navigation. I made the choice to encapsulate them in a UserProfile
class, to simplify the backup.
Each model source is structured differently ; for exemple, the home page URL is stored as a mere URI
object in the UserProfile
instance.
- Favourites are individually represented by the
Fav
class and stored in theHashSet<Fav>
-encapsulatingFavoritesRepository
class. TheHashSet>
was chosen to guarantee each favourite would be represented once. - History entries are represented as
HttpQuery
objects and stored in theSortedDictionary<long, HttpQuery>
-encapsulatingGlobalHistory
class, where thelong
key represents a millisecond-precise timestamp of when the query was initiated. TheSortedDictionnary
was chosen to preserve the order of entries. - The user’s navigation is stored in the
LocalNavigation
class, which encapsulates aLinkedList
. It is optimized for navigating through its nodes.
I made use of the asynchronous possibilities offered by the HttpClient
class I use to execute the user’s HTTP queries, which allows the interface to be still responsive during requests.
Furthermore, I also made heavy use of Linq, thanks to which I seldom accessed IEnumerable<T>
structures through loops, especially in the model classes.
One of the primary features enabling me to organize this project as is are delegates. Each IPresenter
and IView
classes comprises at least two of them, as events are used for upwards communication (from view to presenter to application context).