diff --git a/README.md b/README.md index 95923f9..1468b68 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ This is a study practice repository following [Essential ASP.NET Web Forms Development: Full Stack Programming with C#, SQL, Ajax, and JavaScript](https://learning.oreilly.com/library/view/essential-aspnet-web/9781484257845/) +Markdown files within notes are majorly concept summary, practice will be executed within `/src` folder. + Note: `.gitignore` file is generated by Gitea/GitHub. \ No newline at end of file diff --git a/notes/1_WebApplicationDevelopment.md b/notes/1_WebApplicationDevelopment.md index 8c56810..0140b2b 100644 --- a/notes/1_WebApplicationDevelopment.md +++ b/notes/1_WebApplicationDevelopment.md @@ -2,8 +2,98 @@ ## 1.1 Introduction +Overview of this chapter: +* Client-server model. +* .NET Framework +* ASP.NET and C# Programming +* Visual Studio +* (Practice) How to start a new ASP.NET Web Application project + +## 1.2 Client-Server Model + +Client-Server Model distributes processing btw: +* **server**: provider of resources/services + * e.g. of Web server app: *Internet Information Service (IIS)*, *Apache HTTP Server*, *Oracle iPlanet Web Server* +* **client**: users of resources + * e.g. of Web client app: *Microsoft Internet Explorer*, *Google Chrome*. + +### Web Page: Static or Dynamic + +* Static web page: do not change for all requests. + * Before HTML5, `.html/.htm` files are static web pages. +* Dynamic web page: + * + ![Processing cycle of a static Web page](imgs/493603_1_En_1_Fig2_HTML.jpg) +Processing cycle of a static Web page: +1. Client requests a Web page from a Web server via *HTTP request*. content of request: + 1. Web page + 2. IP of server & client +2. After server received HTTP request, it + 1. locates desired web page file. + 2. Then attach HTML file to HTTP response. + 3. send back to client ![Processing cycle of a dynamic Web page](imgs/493603_1_En_1_Fig3_HTML.jpg) +Processing cycle of a dynamic Web page: +1. Client requests a Web page from a server via an HTTP request. content of request: + 1. name of dynamci Web page (e.g. `Display_Products.aspx`) + 2. state of Web page controls (e.g. name in text box) +2. After server received HTTP request + 1. Check file exentention is `.aspx`, then pass processing control to the business logic of the server app (i.e. ASP.NET & C# code) + 2. If business logic requies service from db (e.g. reading, inserting), the app server pass processing control and related args to db server. + 3. After db server finish execution, it pass control back to app server + 4. App server pass data/response back to web server + 5. Web server formats HTML based on app server's work + 6. Web server attach HTML to HTTP response + 7. Web server sends response back to client -![Organization of the .NET Framework](imgs/493603_1_En_1_Fig4_HTML.jpg) \ No newline at end of file +This is a full backend service processing cycle + +## 1.3 .NET Framework + +* **.NET Framewok** = Windows-based software dev and execution framework +* It consists of + * **Framework Class Library (FCL)**: a large library of classes to create Windows desktop app, or Web app using VB, VC++, VC#, etc. + * **Common Language Runtime (CLR)**: environment where all .NET app executed. (Execution logic shown below) + +![Organization of the .NET Framework](imgs/493603_1_En_1_Fig4_HTML.jpg) + +## 1.4 OOP + +A class can contain *properties* & *methods* and can handle *events*. +* **event** = end-user actions or other things that occur in time. +* properties, methods, events are all **members** of the class + +### 1.4.1 Class and Objects + +2 types of classes in .NET Framework: +* **non-static class**: contain non-static members that we can use, ONLY after we initialize an object from it. +* **static class**: contain static members that can be directly utilized w/o initialization + +Class diagram (e.g. shown below, used to describe class in the book) include: +* name of class +* **namespace** of the class resides in: contain classes that provide specific functionality or specialized tpe +* selected **properties**, **methods**, **events** +* **event handler methods** are omitted in diagram in this book + * event handler methods = handler methods that raised by **event**; begin with "On", end with event name. + +### 1.4.2 Properties + +Properties: +* = data of class +* can be read from (via `get` method) and written to (via `set` method) + +### 1.4.3 Methods + +Omitted + +### 1.4.4 Events + +Events are things that happened +* Raised by user action or sth in future. +* When event is raised, methods are invoked to handle it. + * e.g. .NET Page class raises a **Load** event every time client reload web page. +* Events can be static or non-static for different class. + +#### 1.4.5 Encapsulation \ No newline at end of file diff --git a/notes/imgs/493603_1_En_1_Fig5_HTML.jpg b/notes/imgs/493603_1_En_1_Fig5_HTML.jpg new file mode 100644 index 0000000..c41c05a Binary files /dev/null and b/notes/imgs/493603_1_En_1_Fig5_HTML.jpg differ