Class Notes :

Linx

  • www.flex.org/showcase — Similiar to AJAX — (A)synchronous (J)ava (A)nd (X)ml | e.g. Google Search Refreshing the Search for field
  • http://www.microsoft.com/expression/ (Web Designer Products) — A step for designers to develop upon the data components driven by developer code

Recreational Thought

Rosetta Stone Perl-to-VB. . .

  1. Reduce Flat-File Evaluation WF to SQL-Based. . . (e.g. destination, configuration, logging mechanisms)
  2. How to manage events in high-volume?
  3. VB Driven Process, use SQL and/or Stored Procedures?

Visual Studio 2005 Tips:

 If you’re using the comment feature in Visual Studio

For Example :

// this is a comment

//TODO: mow the lawn

In the lower pane of the Visual Studio (the Task List pane) you can review the TODOs you have in your code. It will ONLY show your //TODO: comments, not all comments.

Thought I’d share

-J

 Definitions :

  • Class : blueprint
  • Object : Instance of a class
  • Field : placeholder in a class for data based on type
  • Property : Assessor to a field; defines what can set or get the data for a field
  • Method : Actions that an object can perform
  • Event : An occurrence (a flag)
  • Encapsulation : Bundling similar functions together, but hiding internal works of a class providing access only through public methods
  • Overloading : defining multiple methods with the same name but different signatures in the same class

Overloading example

Get Sum (int)

{ x + y = z}

Get Sum (short)

When you start to think about data and how you’re managed, access, and manipulate it with .NET think of it as the above defining the context of which you group it.

For example. . . when you want data from a driver’s license you would need to make individual calls to data fields. Do you want to write a function to call each individual field? Do you want to build a list using database connections to query this information per time? Or do you want to create an object that the a class, using methods, could utilize the standard object w/ fields defined and connections configured endless amounts of time. If the object would need to be extended, add new fields with dataconnections extend and then enhance your functionality to the classes w/ methods utilizing these new object references.

 . . . design by Use-Case Scenarios. . . If you review (U)nified (M)odeling (L)anguage you start to deduct the series of classes and methods required to perform the overall functions. (e.g. A DMV case. Updating ID info, renewing information, providing 30 days notice to driver that his/her DL is going to expire, etc)

So you have to review these scenarios possible and plan for ways to handle those requirements for developing your overall .NET plan.

The (5) access modifiers and define where a methos must be located in order to call the method in question?

  • Public — Anything
  • Private — Base Class ONLY
  • Protected — Base & Derived
  • Internal — Base & Assembly
  • Protected Internal — Base, Derived, Assembly

So the syntax to add a field to a class? 

It would be [Access Modifier] [Type] [_nameofField]

private int _nameoffield = 0;

The syntax for adding a method to a class?

[Access Modifier] [field type] [method name] ([field type] [field name])

{

return variable;

}

An example of using a method to calculate data and deliver back to the calling method which returns the value into the messagebox object for display to the user. (using C#)

private INT _nameofField = 0;

x = this.methodname(3,2)

messagebox.show(x)

private int methodname(int num1, int num2)

{

int i = num1 + num2;

return i;

}

—- Now for an overloaded method with the above example would be like this. The overloading will understand which method to use, even though they have the same name, but allow for different amounts and types of data according to the method configuration vs it’s method peers.

private INT _nameofField = 0;

x = this.methodname(3,2)

y = this.methodname(3,2,1)

messagebox.show(x)

private int methodname(int num1, int num2)

{

int i = num1 + num2;

return i;

}

private int methodname(int num1, int num2, int num3)

{

int i = (num1 + num2 + num3) / 3 ;

return i;

}

What are properties used for? to limit a user’s ability to set and/or get information.

So what would you use constructors for? You have these constructors to function at the time an object is instantiated.

As an individual is being requested from a customer database, the constructors aremethods of which we connect to the database, retrieve the data for this method, and making it available for the individual requested.

 ——

Module 5 Notes:

Overriding Base Class? It’s the ability to inherit aspects of a base class, but enhancing the derived class to it’s specific needs. What about Overriding vs Constructors? You want to do both the derived class methods AND do the base class method constructed for the derived class. Overriding will override the base class and only do the derived class method(s). Make sense?

Base Class BankAccount

{

public virtual void deposit(decimal amount)

{}

}

public class SavingsAccount : Bank Account

{

public override void deposit (decimal amount) //overriding the base class, because the base method is “virtual” , which allows overriding

{}

}

BankAccount account = new SavingsAccount(); // Instantiation of new object account using the SavingsAccount which inherits from the Base Class BankAccount

Hiding (C#) /Shadowing (VB) Base Class? It’s the ability to hide aspects of a base class for a derived. You take some aspects from the base class, but you don’t need other aspects so you hide them from your new derived class.