Software Design Principle

Separation of Software Design Principle in MVC:

  1. Model -> Data and Business Logic.
  2. View -> Visual Representation of Model.
  3. Controller -> Process Requests and Prepare Response.

Separating concerns also helps to make our website easier to maintain. With our improved design, if we wanted to create or retrieve our comic, we'd only need to change the central location of our project. It called Repository. This method sometimes called Repository Design Pattern.

Other software design principles:

  1. https://msdn.microsoft.com/en-us/library/ee658124.aspx
  2. https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

Let's do this:

  1. Right-click at project > Add > Folder > name with "Data".
  2. Right-click at data > Add > Class > name with "ComicBookRepository".
  3. Add a method called GetComicBook.
    public ComicBook GetComicBook()
    {
        return null;
    }
    
  4. Go to controller class, then copy the comicBook variable. Move it into GetComicBook().
  5. Our implemetation so far have a major drawback, we could only display one comicbook. What we need is to display some of comicbooks. The idea is list all of the other comic books into array.

results matching ""

    No results matching ""