web_AI-5/presentation/presentation.org

3.2 KiB

Case-Study

Ausgangslage

  • Webshop erstellen
  • Währungsumrechnung CHF zu …
  • Freie Software in Bezug auf Open-Source Code.

Vision

Die Vision wurde anhand eines Mindmaps erstmals grob umfasst:

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/webshop.png

Vision - Artikel

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/Vision-Artikel.png

Vision - Warenkorb

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/Vision-Warenkorb.png

Varianten

C# und SQL Server

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/csharp.png

Laravel und MySQL

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/laravel.png

Django und MariaDB

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/django.png

Kriterien

  • Freie Software
  • Cross Plattform nutzbar
  • Lesbarkeit des Codes
  • Einfachheit des Setups
  • Ohne spezielle Tools nutzbar
  • Vorkenntnisse und Lernfaktor

Vergleich

Variante Erreichte Punktzahl von 235
ASP.NET und SQL Server 141
PHP und MySQL 161
Django und MariaDB 196

Kosten

Laravel Webshop

Sprache Codezeilen
PHP 8679
Total 8679

Django Webshop

Sprache Codezeilen
Python 1460
SQL 4639
Total 6099

Vorgehen

Currencies - App

  • Wurde in Django als eigenen App entwickelt und sollte daher problemlos in andere Applikationen eingebunden werden können.
  • Die Quelle der Währungen ist die Schweizerische Nationalbank mit der URL:

https://www.snb.ch

https://www.snb.ch/selector/de/mmr/exfeed/rss

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/currencies-rss-reader.png

Currencies - Quelle

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/currencies-rss-xml.png

Currencies - Parsing

  • Das Konvertieren des XML's wurde mit Python eigener Module gemacht.
  • für das Herunterladen des XML's wurde das Modul 'urllib' verwendet (1)
  • für das Parsen über die einzelnen items/nodes das Modul xml.etree.ElementTree. (2)
  1. https://docs.python.org/2/library/urllib.html
  2. https://docs.python.org/2/library/xml.etree.elementtree.html

Currencies - Ablauf

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/currencies.png

Infrastruktur

Andreas erzählt wie die infrastruktur aufgebaut ist.

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/Server-Architecture.png

Programmierung

/ibz/web_AI-5/media/commit/a22d0fb7bd6bf476a25b341af7c6fd7efb0290d4/presentation/pictures/form.png
amount_form = CartForm(
    initial={'amount_form': cart_position.amount}
)

Fazit

  • Trotz Model View Controll, SQL unerlässlich.
  • Vagrant (up, suspend, provision, destroy)
  • Git, Python/Django, JS brauchts trotzdem.

Besten Dank für die Aufmerksahmkeit.

Ivan & Andreas