Skip to content

A online shopping website for OOAD final projects with Django

Notifications You must be signed in to change notification settings

Konic-NLP/final-project-OOAD

Repository files navigation

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.

About

A online shopping website for OOAD final projects with Django

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages