De uitdaging

Casestudy: Software bouwen in Python

Mark Pedigo, PhD

Principal Data Scientist

Wat is een casestudy?

  • Pas je skills toe op een realistisch probleem
  • Vereiste courses
    • Software Engineering Principles in Python
    • Intermediate Object-Oriented Programming in Python

Twee mensen in een meeting bespreken een casestudy

Casestudy: Software bouwen in Python

Casestudy-scenario

Hypotheek bepalen voor nieuwbouwwoningen

  • Leningadviseur bij PyBank Financial
  • Bouw een programma om
    • Bepaalt woningbudget
    • Bepaalt maandlast
  • Disclaimer: alleen ter illustratie

loan_officer.jpg

Casestudy: Software bouwen in Python

Plan van aanpak

  • Software automatiseert de berekeningen
  • Met software-engineeringprincipes, gebaseerd op classes
  • Fases
    • Basisrekenmachine
      • +, -, *, /, **
    • Financiële rekenmachine
      • Rente, rentevoet berekenen
    • Hypotheekrekenmachine
      • Leningbedrag, aflossingen berekenen

Drie rekenmachines, oplopend in grootte

Casestudy: Software bouwen in Python

Overerving

Code wordt hergebruikt tussen classes

  • De child class (FinancialCalculator) erft alle functionaliteit van de parent (BasicCalculator)
  • Child class kan extra functionaliteit toevoegen
class BasicCalculator:
    def multiply(self, x, y):
        result = x * y
        return result
  ...
# Child of BasicCalculator
class FinancialCalculator(BasicCalculator):
    def months_from_years(self, years):
        # Inherits the .multiply() method
        return self.multiply(years, 12)
    ...
Casestudy: Software bouwen in Python

Herhaling: software-engineeringprincipes

  • Modulaire, schone, leesbare, efficiënte code
    • Overerving, methods
  • Hergebruik libraries, frameworks, bestaande oplossingen
    • Pas bestaande code aan
    • Versnel ontwikkeling
  • Duidelijke documentatie, comments, gebruiksgidsen
    • Documentatie
  • Testen
    • doctest en unit tests

Een computer omringd door iconen voor software engineering

Casestudy: Software bouwen in Python

Roadmap

Roadmap met de verschillende onderdelen van het project.

Casestudy: Software bouwen in Python

Aan de slag!

Casestudy: Software bouwen in Python

Preparing Video For Download...