1 / 14

Exploring Objects with the Debugger

Exploring Objects with the Debugger. Objects & Programming. Programming is the act of writing instructions that tell a computer how to do something

Download Presentation

Exploring Objects with the Debugger

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Exploring Objects with the Debugger

  2. Objects & Programming • Programming is the act of writing instructions that tell a computer how to do something • Objects allow us to represent computer technology in our code so that we may send command (methods) & access settings (properties) of the computer technology • Lots of different parts to the computer system so we need lots of different kinds of object

  3. Types of Object • For this module we shall split them into the following categories… • Web Forms and Controls We use these to create the interface in the presentation layer • .NET Library Objects Ready made objects allowing us to do things such a print or send emails • Variables These objects allow us to control the computer’s RAM • Custom Objects You may create your own objects to perform a whole host of tasks

  4. Lab Work so far

  5. The Send Password Program • We have almost certainly used a program like this before...

  6. Computer Technology Involved • The user… • Enters their email address • Presses the send password button • Technology to control • Keyboard, screen, mouse • The system • Queries the database • Sends an email to the user • Technology to control • Database file, RAM, E Mail Message, E Mail Server

  7. Objects we will use… • Keyboard Control objects • Screen Control objects • Mouse Control objects • Database Custom object(s) • RAM Variables • E Mail Message .NET Library Object • E Mail Server .NET Library Object

  8. System Input-Output Provides tools for file input and output Drawing Provides graphical drawing tools Web Provides tools for Internet interconnectivity Data Provides tools for accessing databases .NET Library • Huge library of ready made classes • Two classes of interest • System.Net.Mail.MailMessage Controls the email message • System.Net.Mail.SmtpClient Controls the email server

  9. Creating an E Mail • Create the following e mail… • Dim myMessage As New System.Net.Mail.MailMessage • (“you@whatever.com”, “johnsmith@nowhere.com”, “Hello John”,”Hi this is a test!”)

  10. Sending the EMail Dim myMessage As New System.Net.Mail.MailMessage (“you@whatever.com”, “johnsmith@nowhere.com”, “Hello John”,”Hi this is a test!”) Dim Server As New System.Net.Mail.SmtpClient("mail.dmu.ac.uk") Server.Send(myMessage) • Note the use of parameters! • Parameters do a similar job to the assignment statement

  11. Encapsulation • Hides the complexity contained inside the object • Variables – RAM • DataConnection – Database • Mail Message Objects - Email • SMTP Client – E Mail Server

  12. Presentation Middle Layer .NET and Custom Objects Data Layer Database I N T E R F A C E Events C O D E Q U E R I E S Parameters T A B L E S Send Password Architecture

  13. Click Event Handler • There is a lot of code to think about so how do we make life simpler?

  14. Break Points • Allow us to stop the program, run it one line at a time and inspect variable. • Press F9 to turn break points on and off

More Related