145 lines
3.2 KiB
Org Mode
145 lines
3.2 KiB
Org Mode
#+TITLE: Case-Study
|
|
#+AUTHOR: Ivan Hörler und Andreas Zweili
|
|
#+OPTIONS: toc:1 num:nil
|
|
#+REVEAL_TRANS: linear
|
|
#+REVEAL_THEME: solarized
|
|
#+REVEAL_ROOT: https://cdn.jsdelivr.net/reveal.js/3.0.0/
|
|
#+LANGUAGE: de
|
|
|
|
* 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:
|
|
|
|
#+ATTR_HTML: :width 70%
|
|
[[file:pictures/webshop.png]]
|
|
|
|
** Vision - Artikel
|
|
|
|
#+ATTR_HTML: :width 80%
|
|
[[file:pictures/Vision-Artikel.png]]
|
|
|
|
** Vision - Warenkorb
|
|
|
|
#+ATTR_HTML: :width 80%
|
|
[[file:pictures/Vision-Warenkorb.png]]
|
|
|
|
* Varianten
|
|
|
|
** C# und SQL Server
|
|
|
|
[[file:pictures/csharp.png]]
|
|
|
|
** Laravel und MySQL
|
|
|
|
[[file:pictures/laravel.png]]
|
|
|
|
** Django und MariaDB
|
|
|
|
[[file: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* |
|
|
|---------+------------|
|
|
#+TBLFM: @>$2=vsum(@2..@-1);%.0f
|
|
|
|
** Django Webshop
|
|
|
|
| Sprache | Codezeilen |
|
|
|---------+------------|
|
|
| Python | 1460 |
|
|
| SQL | 4639 |
|
|
|---------+------------|
|
|
| *Total* | *6099* |
|
|
|---------+------------|
|
|
#+TBLFM: @>$2=vsum(@2..@-1);%.0f
|
|
|
|
* 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
|
|
|
|
#+ATTR_HTML: :width 80%
|
|
[[file:pictures/currencies-rss-reader.png]]
|
|
|
|
** Currencies - Quelle
|
|
|
|
[[file: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
|
|
|
|
#+ATTR_HTML: :width 55%
|
|
[[file:pictures/currencies.png]]
|
|
|
|
** Infrastruktur
|
|
|
|
#+BEGIN_NOTES
|
|
Andreas erzählt wie die infrastruktur aufgebaut ist.
|
|
#+END_NOTES
|
|
|
|
#+ATTR_HTML: :width 90%
|
|
[[file:pictures/Server-Architecture.png]]
|
|
|
|
** Programmierung
|
|
|
|
#+ATTR_HTML: :width 60%
|
|
[[file:pictures/form.png]]
|
|
|
|
#+BEGIN_SRC python
|
|
amount_form = CartForm(
|
|
initial={'amount_form': cart_position.amount}
|
|
)
|
|
#+END_SRC
|
|
|
|
|
|
* 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
|