Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming the Web Using Visual Studio .NET

Similar presentations


Presentation on theme: "Programming the Web Using Visual Studio .NET"— Presentation transcript:

1 Programming the Web Using Visual Studio .NET

2 Introduction VS.NET permits programming in a visual environment
That means developing via forms using drag-and-drop techniques Hand-coding is available also We’ll be using Visual Basic.NET

3 Object-Oriented Concepts
Object-oriented programming Certain block of code treated as reusable objects Accept certain inputs Produce certain outputs Keep track of certain data (values) Programmer doesn’t have to know how the output is produced, only how to manipulate the object Programmer has to know what parts of an object can be manipulated by what means

4 Object-Oriented Concepts
Properties Contain values Addressable That is, programmer has access to the property Access can be restricted Local access only Controlled “Friendly” access A known caller Global access No control – any program can access

5 Object-Oriented Concepts
Methods Functions that the object can perform Can supply data via arguments Can return a value Don’t have to know how they work Do have to know: What do you give it (parameters) What do you get back (return value) What it changes (properties) It is a way to safely access or change properties e.g. a method could accept a request for a withdrawal from an ATM Validate the amount is between $10 and $400 before issuing the money and updating accounts

6 Object-Oriented Concepts
Events Triggers that are activated in specific situations Affects object without user intervention Many objects are already part of the VS.NET environment You don’t have to create them, only use them You can build your own objects if you need to

7 Object-Oriented Concepts
Objects are derived from classes Classes are basically templates Car is a class 4 wheels Engine An object is an instance of a class Creating an object is called instantiation Making a Honda is instantiating a car VIN JHMEJ854*WC is a specific car

8 Object-Oriented Concepts
Encapsulation Objects can be used without knowing what goes on inside them Inheritance New classes can be created based on base classes Each new derived class Inherits the properties and methods of the base class May have properties and methods not in the base class

9 Object-Oriented Concepts
Polymorphism Properties and methods of both base and derived classes can have the same name and be used in the same way - or - Definitions can do different “tasks” depending on the type of data worked with This means that the output of a method may be produced by completely different internal processing methods (using the same “name”) The user doesn’t care You’ve used a type of polymorphism in JavaScript + operator In a math context it adds the numbers In a string context it concatenates the strings

10 .NET Structures & Languages
Common Language Runtime (CLR) CLR is an intermediate state Not source Not object Makes VS.NET applications machine independent Code running within the CLR is called managed code Allows VB, C++, C# code to easily co-exist

11 .NET Structures & Languages
Communications protocols VS.NET supports many TCP/IP is the most common HTTP FTP Necessary for networked environment Multiple computers Multiple operating systems Encoding formats ISO Unicode

12 .NET Structures & Languages
VS.NET supports Visual Basic (VB.NET) C# J# (discontinued) C++ Others being added We’ll be using VB.NET It’s components are …

13 .NET Structures & Languages
Variables Strongly typed Name begins with alphabetic character May contain alphabetic characters or digits No special characters or punctuation symbols No more than 255 characters in length Cannot match a reserved word Declaration examples: Dim SSN as String Dim salesTax, interest as Double Dim age as Integer

14 .NET Structures & Languages
Constants Literals (simply a value): Const 19.95 Symbolic (includes name): Const TVPrice=19.95 Comments Begins with apostrophe

15 .NET Structures & Languages
Data types Boolean Byte Char Date Double Integer Long Object Single String User-defined

16 .NET Structures & Languages
Operators Assignment = Arithmetic + - / * ^ Relational < <= = <> >= > Like Wild cards * ?

17 .NET Structures & Languages
Operators (cont.) Logical and or Concatenation + & Concat Result = String.Concat(Str1, Str2)

18 .NET Structures & Languages
Control Structures If…Then…Else…End If Note: {} not needed Select…Case Do While…Loop Do…Loop While|Until… While…End While For…To…Next

19 Example Application What savings are needed to achieve a specific retirement goal? Variables Amount desired at retirement Amount saved each month Time until retirement Interest rate

20 Example Application Web page format (client or user side)
Welcome page with link to a form Data entry form Results shown in browser window Could be update of current page Could be a new page Validation of input on client side JavaScript Ensure numbers are numbers Ensure data is within a valid range Etc. Processing on server side Computations (usually intensive) Retrieval of sensitive data Preparation of presentation of data

21 Example Application Server-side processing is a little different
Web form Web page in HTML Contains a form: <form>… Form “written” in HTML on client side Sent to the client from the server Page & form start on server Contains HTML and other elements (XML) Application also includes code behind the page Web form and Code-Behind page automatically generated by VS.NET


Download ppt "Programming the Web Using Visual Studio .NET"

Similar presentations


Ads by Google