CIS266 Midterm Review


Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

CIS266 Midterm Review

  1. 1. CIS-266 Midterm Study Guide
  2. 2. Midterm <ul><li>Open book, open notes </li></ul><ul><li>Covers Chapters 1, 2, 3, 4, 5, 19 </li></ul><ul><li>True/False, Multiple Choice, Fill In, Short Answer </li></ul><ul><li>Bring a pen or pencil </li></ul>
  3. 3. Class Library <ul><li>Stores all classes and interfaces of the .NET language </li></ul><ul><li>Namespaces – sections within the library that contain classes, structures, enumerations, delegates, interfaces </li></ul>
  4. 4. Class Library - Types <ul><li>Refer to classes, structures, enumerations, delegates, interfaces, data types </li></ul><ul><li>Any element used in the As clause </li></ul><ul><ul><li>Dim AnyName As SomeType </li></ul></ul><ul><li>Value types : each holds own value </li></ul><ul><li>Reference types : points to location </li></ul>
  5. 5. MDI <ul><li>Projects can contain </li></ul><ul><ul><li>Multiple parent forms </li></ul></ul><ul><ul><li>Multiple child form </li></ul></ul><ul><ul><li>Independent forms (the splash screen) </li></ul></ul><ul><li>When you close a parent form, all of its children close </li></ul><ul><li>A child cannot wander out of its parent’s area </li></ul>
  6. 6. The Window Menu <ul><li>Create a Window menu for parent forms </li></ul><ul><ul><li>List open child windows </li></ul></ul><ul><ul><li>Allow users to arrange child windows </li></ul></ul><ul><li>Window Layout Options </li></ul><ul><ul><li>Me.LayoutMdi(MdiLayout.TileVertical) </li></ul></ul><ul><ul><li>Me.LayoutMdi(MdiLayout.TileHorizontal) </li></ul></ul><ul><ul><li>Me.LayoutMdi(MdiLayout.Cascade) </li></ul></ul>
  7. 7. Context Menus <ul><li>Also called shortcut or popup menus </li></ul><ul><li>Use the regular menu designer to create a menu </li></ul><ul><li>Assign the top-level menu name to the ContextMenu property of the form and/or controls on the form </li></ul>
  8. 8. OOP Terminology-Abstraction <ul><li>A model of an object that determines </li></ul><ul><ul><li>Characteristics  properties </li></ul></ul><ul><ul><li>Behaviors  methods </li></ul></ul>
  9. 9. OOP Terminology-Encapsulation <ul><li>Combination of characteristics of an object along with its behaviors  one “package” </li></ul><ul><li>Data hiding </li></ul><ul><ul><li>Properties and procedures are hidden </li></ul></ul><ul><ul><li>Programmer controls “exposure” of properties and methods available to other objects </li></ul></ul>
  10. 10. OOP Terminology-Inheritance <ul><li>The ability to create a new class from an existing class </li></ul><ul><li>The existing (original) class is called the base, superclass, or parent </li></ul><ul><li>The inherited class is called the derived, subclass, or child </li></ul><ul><li>A derived class has an “is a” relationship with its base class </li></ul>
  11. 11. OOP Terminology-Inheritance Public Class frmMain Inherits System.Windows.Forms.Form
  12. 12. OOP Terminology-Inheritance <ul><li>Inheritance supports reusability </li></ul><ul><li>Place common code in a base class </li></ul><ul><li>Derived classes can call shared functions </li></ul>Reusability – creation of object functionality that may be used in multiple projects
  13. 13. OOP Terminology - Polymorphism <ul><li>Methods with identical names have different implementations </li></ul><ul><li>The Select method is different for radio buttons, check boxes, and list boxes </li></ul><ul><li>Allows a single class to have more than one method with different argument lists </li></ul>
  14. 14. Multitier Applications <ul><li>Three-tier applications are popular </li></ul><ul><ul><li>Presentation tier </li></ul></ul><ul><ul><li>Business tier </li></ul></ul><ul><ul><li>Data tier </li></ul></ul><ul><li>Goal is to write components that can be replaced without replacing other components </li></ul><ul><li>“ Plug-in” new components </li></ul>
  15. 15. Throwing and Catching Exceptions <ul><li>The system throws an exception when a run-time error occurs </li></ul><ul><li>Your program can catch the exception and take an action </li></ul><ul><ul><li>Use the Try/Catch block to enclose code that could cause an exception </li></ul></ul><ul><li>OR </li></ul><ul><li>Ignore the exception </li></ul>
  16. 16. What Exception to Throw? <ul><li>Use existing .NET Framework exception classes </li></ul><ul><li>Create your own exception that inherits from existing exceptions </li></ul><ul><li>Use the System.ApplicationException class when you throw your own exceptions from application code </li></ul>
  17. 17. Shared Variables <ul><li>Instance variables (properties) are values associated with each new instance of an object </li></ul><ul><li>Use shared variables (properties) for data common to class </li></ul>Private Shared mintNumberProcessed as Integer Private Shared mdecTotalPay As Decimal Private Shared mdecOvertimeHours As Decimal
  18. 18. Retrieving Shared Variables <ul><li>When placed on a Public Get method, the Shared keyword makes values accessible without instantiating the object of the class </li></ul>Shared ReadOnly Property NumberProcessed() As Integer Get Return intNumberProcessed End Get End Property
  19. 19. Creating an Enumeration <ul><li>An enum is a list of named constants </li></ul><ul><li>The data type of the constants must be integer (short, long, byte) </li></ul>
  20. 20. Collections <ul><li>Container for a group of like items </li></ul><ul><li>Need to be able to Add, Remove </li></ul><ul><li>Include an Item Property to return an individual member </li></ul><ul><ul><li>Typically the default property </li></ul></ul>
  21. 21. ADO.NET <ul><li>Microsoft’s latest database object model </li></ul><ul><li>Allows .Net programmers to use a standard set of objects to refer to data from any source </li></ul><ul><li>Uses disconnected datasets with common data representation (data types) from multiple sources </li></ul>
  22. 22. ADO.NET Providers <ul><li>Data Providers manipulate the data using SQL statements or stored procedures </li></ul><ul><ul><li>SQLClient  for SQL Server </li></ul></ul><ul><ul><li>OracleClient  for Oracle databases </li></ul></ul><ul><ul><li>OleDbClient  for all other database formats </li></ul></ul><ul><ul><li>An ODBC provider is available for older apps </li></ul></ul>
  23. 23. Data Provider Objects <ul><li>Connection object – link to a data source </li></ul><ul><li>Command object – stores and executes SQL statements </li></ul><ul><li>DataAdapter object – handles retrieving and updating data in a DataSet object </li></ul><ul><ul><li>Includes commands and connection </li></ul></ul>
  24. 24. ADO.NET Components <ul><li>DataSet Objects  holds a copy of the data in memory </li></ul><ul><li>Dataset objects can be populated with data from many sources </li></ul><ul><li>Regardless of the data source, code handles DataSet objects the same </li></ul><ul><li>Dataset objects hold one or more DataTable objects </li></ul>
  25. 25. Use the DataSet object <ul><li>To transfer data between tiers </li></ul><ul><li>To manipulate the data without an open connection </li></ul><ul><li>To relate data from multiple sources </li></ul><ul><li>To bind data to a Windows form </li></ul>
  26. 26. XML Schema File <ul><li>Describes the fields, data types, and constraints </li></ul><ul><li>View dataset schema in the .xsd file found in the Solution Explorer </li></ul>
  27. 27. Populating Combo Boxes with Data <ul><li>Set the DataSource property </li></ul><ul><ul><li>Connects to the dataset </li></ul></ul><ul><li>Set the DisplayMember property </li></ul><ul><ul><li>Connects to the field name </li></ul></ul><ul><li>Use the ValueMember if want to refer to a different field than the one displayed </li></ul><ul><li>The SelectedValue specifies the field that receives the selection </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.