web_AI-5/presentation/presentation.org

3.3 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/515cc9e18e075867b564612c6699fad938dea862/presentation/pictures/webshop.png

Vision - Artikel

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

Vision - Warenkorb

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

Varianten

ASP.NET (C#) und SQL Server

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

Laravel (PHP) und MySQL

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

Django und MariaDB

/ibz/web_AI-5/media/commit/515cc9e18e075867b564612c6699fad938dea862/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
Laravel und MySQL 161
Django und MariaDB 196

Kosten

Tools

  • Ausgaben während der Case-Study: 0.00 CHF
  • 100% freie Software
  • "Let's Encrypt" für SSL
  • "freenom.com" für Domain

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/515cc9e18e075867b564612c6699fad938dea862/presentation/pictures/currencies-rss-reader.png

Currencies - Quelle

/ibz/web_AI-5/media/commit/515cc9e18e075867b564612c6699fad938dea862/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/515cc9e18e075867b564612c6699fad938dea862/presentation/pictures/currencies.png

Infrastruktur

Andreas erzählt wie die infrastruktur aufgebaut ist.

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

Programmierung

/ibz/web_AI-5/media/commit/515cc9e18e075867b564612c6699fad938dea862/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