Giter VIP home page Giter VIP logo

final-project-ooad's Introduction

Buff Shop

General

This repo contains our final project for the CSCI5448.

Group memebers: Sijia Ge, Xiaosong Wang, Zhiyong Wang

Based on python 3.6 and Django 2.0

Documentations

Demonstration Video: link

Final Project Report: link

Final Class Diagram: link

UML for Project5: link

UML for Project6: link

Documentation of UML changes: link

OO Patterns

  1. MTV

    The MTV (a variant of MVC, means Model, Template and Views) pattern built-in Django really brings the whole system loose coupling and high cohesion. It split different functions into different modules. The models in the MTV pattern, which are defined in the models.py files, handle the object-relational mapping between the system and the database.It offer the API for us to execute query and extract or store the data. The templates in the MTV pattern are made up of multiple HTML for different pages, which plays the role of view in MVC to display the UI to the users. They contain the surface static contents, including text and pictures of the web pages, and they also contain functions written in javascript, which can fulfill the basic interactions between the user and the system. The views in the MTV pattern mediate between the models and the templates, like the controller in MVC, passing front-end requests to the model and passing back-end information to the templates (or to the user).

  2. Decorator

    The Decorator pattern in Django framework is functional-based: the decorator function wraps up other functions. In our project, Namely, in our system, we force the user to log in if they want to add items to or edit the shopping cart. To achieve this, a login function wrap the functions written in the view.py of the cart folder, which handles the add item request, edit request, visit cart request, and delete cart request. Before running those functions, the system will call the decorator function login first, judging if the user is in login status, and then it will call the function wrapped in the decorator.

  3. Command

    The command pattern is used in our project. The template receives the request from the users and it plays the role of the invoker since the template decouples from the view, who is in charge of processing the request and response to the user. The URL route plays the role of command, which get the request and send it to the suitable object(function) in the file to process the request.

  4. Proxy

proxy pattern implemented by the class meta property in the django framework. The client can access to the goodinfo tables by the proxy tabels while cannot change the data in the goodsinfo(like insert,delete). And the order method in goodsinfoproxy can be ordered by one fied without impacting the order of goodsinfo.

Install and Run

first, please create a virtual enviorment

pip install virtualenv

virtualenv [the name for the environment] e.g virtualenv venv

activate the virtual enviroment

source activate [the name for the virtualvenv]

To intall all the packages:

pip install -Ur requirements.txt 

To run the project:

python manage.py runserver

Citation and Credit

This project is adapted by and inspired from a daily fresh project.

final-project-ooad's People

Contributors

konic-nlp avatar ravenouse avatar simonxw avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.