User interface programming in c model view controller
Download
1 / 15

User Interface Programming in C: Model-View-Controller - PowerPoint PPT Presentation


  • 190 Views
  • Uploaded on

User Interface Programming in C#: Model-View-Controller. Chris North CS 3724: HCI. GUI Topics. Components GUI layouts Events Graphics Manipulation Animation Databases MVC. Review: Direct Manipulation. DM Definition? (Shneiderman) DM processing steps? 1. 2. . 2 Challenges!.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'User Interface Programming in C: Model-View-Controller' - hamlet


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
User interface programming in c model view controller l.jpg

User Interface Programming in C#: Model-View-Controller

Chris North

CS 3724: HCI


Gui topics l.jpg
GUI Topics

  • Components

  • GUI layouts

  • Events

  • Graphics

  • Manipulation

  • Animation

  • Databases

  • MVC


Review direct manipulation l.jpg
Review: Direct Manipulation

  • DM Definition? (Shneiderman)

  • DM processing steps?

    • 1.

    • 2.


2 challenges l.jpg
2 Challenges!

  • User interface design

  • Software architecture design


Software architecture so far l.jpg
Software Architecture so far…

Program State -data structures

Paint event-display data

Interaction events

-modify data


Model view controller mvc l.jpg
Model-View-Controller (MVC)

Model

Program State -data structures

View

Paint event-display data

Controller

Interaction events

-modify data


Model view controller mvc7 l.jpg
Model-View-Controller (MVC)

refresh

Data display

View

User input

Controller

UI:

events

refresh

manipulate

Data model

Model

Data:


Advantages l.jpg
Advantages?

  • Multiple views for a model

    • Multi-view applications (overview+detail, brushing,…)

    • Different users

    • Different UI platforms (mobile, client-side, server-side,…)

    • Alternate designs

  • Multiple models

  • Software re-use of parts

  • Plug-n-play

  • Maintenance


  • Multiple views l.jpg
    Multiple Views

    Controller

    View

    View

    Controller

    Model


    Common variation l.jpg
    Common Variation

    Data display

    View

    Data manipulation logic

    Controller

    Data model

    Model


    E g c treeview control l.jpg
    E.g. C# TreeView Control

    TreeView control

    View

    Controller

    treeView1.Nodes

    Java:

    model listeners

    Nodes collection

    Model


    C database controls l.jpg
    C# DataBase Controls

    DataGrid control

    -scroll, sort, edit, …

    View

    Controller

    DataSet class

    -tables

    -columns

    -rows

    Model


    C database access ado net l.jpg
    C# DataBase Access (ADO.net)

    • OleDB, ODBC, SQLdb, …

    • Steps to get data:

      • dbConnection: connect to DB

      • dbCommand: SQL query text

      • dbAdapter: executes query

      • DataSet: resulting data

  • Steps to display data:

    • Bind to UI control, DataGrid

    • or Manual data processing

  • Built-in XML support too

  • DB

    Alternative: DataReader,

    retrieve data incrementally


    Db example l.jpg
    DB Example

    • Get data:

      Using System.Data.OleDb; // “Jet” = MS Access DB driver

      con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/mydb.mdb”);

      cmd = new OleDbCommand("SELECT * FROM mytable”, con); // SQL query

      adpt = new OleDbDataAdapter(cmd);

      data = new DataSet( );

      adpt.Fill(data); // execute the query and put result in ‘data’

    • Display data:

      dataGrid1.DataSource = data.Tables[0]; // show the table in the grid control

      MessageBox.Show(data.Tables[0].Rows[0][5].ToString( )); // or process manually, this is row 0 col 5


    Gui topics15 l.jpg
    GUI Topics

    • Components

    • GUI layouts

    • Events

    • Graphics

    • Manipulation

    • Animation

    • Databases

    • MVC


    ad