Download presentation
Presentation is loading. Please wait.
1
Getting Started with PowerShell Jump Start
Susan Ibach | Technical Evangelist Christopher Harrison | Content Developer
2
Meet Susan Ibach| @hockeygeekgirl
Technical Evangelist Helping developers understand Visual Studio, app building Microsoft Certified Trainer My first program was written in basic on a computer with 64K of memory Will not admit how many years coding experience Basic, Fortran, COBOL, VB, C#, HTML, Python Frequent blogger and presenter marathoner, wife, and mother of two awesome boys!
3
Meet Christopher Harrison | @geektrainer
Content Developer Focused on ASP.NET and Office 365 development Microsoft Certified Trainer Still misses his Commodore 64 Long time geek Regular presenter at TechEd Periodic blogger Certification advocate Marathoner, husband, father of one four legged child
4
Course Topics Getting Started with PowerShell
01 | Flask application design 04 | Python to databases 02 | Object oriented programming 05 | Jinja layouts 03 | Introduction to databases 06 | Introduction to Bootstrap
5
Setting Expectations Target Audience
New Python developers looking to take the "next step" Burgeoning web developers Some Python experience Suggested Prerequisites/Supporting Material Introduction to Programming with Python MVA
6
Join the MVA Community! Microsoft Virtual Academy
Free online learning tailored for IT Pros and Developers Over 1M registered users Up-to-date, relevant training on variety of Microsoft products “Earn while you learn!” Get 50 MVA Points for this event! Visit Enter this code: SQLPythonFlask (Exp: 4/6/2015)
7
01 | Flask Design Susan Ibach | Senior Technical Evangelist
Christopher Harrison | Content Developer
8
Flask is a unique platform...
It provides a way to create web applications... Without forcing you into a structure
9
When your application grows, things can get messy
Code duplication Spaghetti code Debugging issues Performance issues
10
Flask Design Design concepts Packages
11
Design concepts
12
I find it immensely helpful to work on the assumption that I am too stupid to get things right. This leads me to conservatively use what has already been shown to work, to cautiously test out new ideas before committing to them, and above all to prize simplicity. - Jonathan Edwards
13
When doing design... Keep it simple! Use what's already there
Don't be afraid of using an existing framework Don't let pride get in the way of using someone else's code Make changes as needed Design with change in mind, because there will always be changes
14
Core concepts Write once, use everywhere Use layers Use patterns
Copy/paste is bad Even if it's just two lines of code Especially if it's a string that could change like a server name Use layers Each layer has a job Data access layer is responsible for getting data from a database Business logic layer is responsible for enforcing rules Use patterns
15
What's a pattern? A pattern is a recipe to be used to solve a problem
Recipes do not need to be followed exactly Substitutions are made based on allergies, ingredients on hand, personal preferences, etc. Use what fits, and modify where it doesn't
16
Introducing Model, View, Controller (MVC)
MVC is a pattern Three basic parts Model, which is your data View, which is what the user will see Controller, which takes the user request and gets the job done
17
Models, Views, and Controllers
01: Exploring ASP.NET MVC 4 What does MVC look like? Request Controller Retrieves Model “Does Stuff” user Model Response View Visually represents the model
18
How about an analogy? Think about being at a restaurant
Your server is the controller He's responsible for taking your order, going back to the kitchen to get your order, and delivering it The food is the model That's what you're trying to get The plate and other accoutrements are the view It's all about the presentation
19
How does this apply to Flask?
20
Packages
21
What is a package? A packaged block of code Folders and modules
Folders become containers The modules are inside of folders
22
Why use packages? We can't keep adding code to a single file
We can't keep adding files to a single folder
23
Different packages for different portions of your application
admin data dataaccess.py models user.py permission.py quiz data dataaccess.py models question.py category.py
24
How do you create a package?
A package at the end of the day is a folder The folder can contain py files and other folders Each folder must contain a file called __init__.py That is two underscores on each side It's a keyword, just go with it It's the first file that will be called Use it to initialize the environment, import files, etc.
25
How do you reference items in a package?
Use dotted notation Method inside server.py? admin.data.server.method() Method inside question.py? quiz.models.question.method() admin data server.py models user.py permission.py quiz data dataaccess.py models question.py category.py
26
Adding packages to our application
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.