140 likes | 297 Vues
This mini-lecture provides an overview of the Model-View-Controller (MVC) framework and essential database concepts, focusing on how they relate to computational science. In less than 30 minutes, participants will learn about the philosophy of MVC, breaking down programs into manageable parts, and the structure of databases. Practical examples include creating a simple database and understanding the relationships between models, views, and controllers. The session will also include time for homework questions to reinforce the material covered.
E N D
Agenda • Mini Lecture (less than 30 min) • MVC • Database Basics • Programming Diagrams • Simple Database Creation (class example) • Time for Homework Questions (10-15 min)
Abstract Thinking • Break down the program into small pieces • Small things are easier to understand • Think about how “parts” are related • Objects are Great for Abstraction!
Model View Controller (MVC) • MVC is a philosophy • MVC helps thinking about User Interface (UI) • Breaks up workload among programmers • Design Pattern for Abstraction
Model • Information or Data • Where the Data Lives • The Controller asks the Model for data • The model can either generate OR create the data as needed
View • Is the User Interface • We edit the View to change user experiences • Stick with current practices
Controller • Handles User Actions • Interprets the View and feeds input to the Model, then updates the view based on the model output • Controllers have Input & Output
Databases • A database is a collection of tables • Like Excel Tables • Rows and Columns • Columns are categories • Rows are entries • MUST have a UID (Unique ID) Column
Tables Names Addresses Envelopes
Drawing a Diagram • Draw a picture of your program • Helps to see the relations between parts of your program • Draw pictures that work for you • Should be clear to others
Now To Code • Creating a Database • we will create a basic DB
Database Steps To Remember • Data -> add new data source • Show Database Explorer • Show Data Sources • Save your Project • (Cannot save to a network drive!) • Add data to the database
Adding to a Database • Data Grid View • Details • Can add to the database • Recompiling the program will change also update the database