Skip to content

Implementing the Presenter architectural pattern alongside MVC (using Sinatra)

Notifications You must be signed in to change notification settings

Integralist/MVCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MVCP (Model View Controller Presenter)

This is a Sinatra based application running an MVCP architecture

Usage

First install the dependencies: gem install bundler && bundle

Then from there whenever you want to run the Sinatra app: bundle exec shotgun

Application Architecture

Within the config.ru we load a helper module and the main Application Controller.

Routing is handled within config.ru using the Rack map method and that loads the relevant Controller.

All other Controllers inherit from the Application Controller.

We get data from our Models and because we have lots of components (all of which potentially have lots of data that would normally be set-up by the Controller) we will use the Presenter pattern to get the data from the Models instead and then have a presenter handle the preparation of view data.

Directory Structure

  • app
    • controllers
    • helpers
    • models
    • presenters
    • views
      • components
  • public
    • scripts
    • styles

About

Implementing the Presenter architectural pattern alongside MVC (using Sinatra)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages