E-Book, Englisch, 415 Seiten
Joshi Beginning SOLID Principles and Design Patterns for ASP.NET Developers
1. ed
ISBN: 978-1-4842-1848-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 415 Seiten
ISBN: 978-1-4842-1848-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
This book teaches you all the essential knowledge required to learn and apply time-proven SOLID principles of object-oriented design and important design patterns in ASP.NET Core 1.0 (formerly ASP.NET 5) applications. You will learn to write server-side as well as client-side code that makes use of proven practices and patterns.SOLID is an acronym popularized by Robert Martin used to describe five basic principles of good object-oriented design--Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation and Dependency Inversion. This book covers all five principles and illustrates how they can be used in ASP.NET Core 1.0 applications.Design Patterns are time proven solutions to commonly occurring software design problems. The most well-known catalog of design patterns comes from Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, the so-called as GoF patterns (Gang of Four patterns). This book contains detailed descriptions of how to apply Creational, Structural and Behavioral GoF design patterns along with some Patterns of Enterprise Application Architecture. Popular JavaScript patterns are covered, along with working examples of all these patterns in ASP.NET Core 1.0 and C# are included.
What You Will Learn:How to apply SOLID principles to ASP.NET applications
How to use Gang of Four (GoF) design patterns in ASP.NET applications
Techniques for applying Patterns of Enterprise Application Architecture cataloged by Martin Fowler in ASP.NET applications
How to organize code and apply design patterns in JavaScript
Who This Book Is For:This book is for ASP.NET developers familiar with ASP.NET Core 1.0, C# and Visual Studio.
Bipin Joshi is a software consultant, a trainer and an author with 20+ years of experience in software development. He conducts professional training programs on ASP.NET and web technologies through his own company- BinaryIntellect Consulting. Bipin has authored or co-authored more than half a dozen books and numerous articles on .NET technologies. He has worked with .NET ever since its inception and was awarded as a Microsoft MVP between 2002 and 2008. He was also a Microsoft Certified Trainer during that period.
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;6
2;Contents;8
3;About the Author;16
4;About the Technical Reviewer;18
5;Introduction;20
6;Chapter 1: Overview of SOLID Principles and Design Patterns;23
6.1;Overview of Object-Oriented Programming;23
6.1.1;Classes and Objects;24
6.1.2;Abstraction;24
6.1.3;Encapsulation;25
6.1.4;Inheritance;28
6.1.5;Abstract Classes and Interfaces;29
6.1.6;Polymorphism;31
6.1.6.1;Polymorphic Behavior Through Inheritance;31
6.1.6.2;Polymorphic Behavior Through Interfaces;34
6.2;Overview of SOLID Principles;36
6.2.1;Single Responsibility Principle (SRP);37
6.2.2;Open/Closed Principle (OCP);37
6.2.3;Liskov Substitution Principle (LSP);37
6.2.4;Interface Segregation Principle (ISP);38
6.2.5;Dependency Inversion Principle (DIP);38
6.3;Design Patterns;38
6.3.1;Gang of Four Design Patterns;39
6.3.2;Categorization of GoF Patterns;39
6.3.2.1;Creational Design Patterns;40
6.3.2.2;Structural Design Patterns;40
6.3.2.3;Behavioral Design Patterns;40
6.4;Martin Fowler’s Patterns of Enterprise Application Architecture;41
6.4.1;Categorization of P of EAA;42
6.5;Design Patterns in JavaScript;42
6.6;Applying Design Principles and Patterns;43
6.7;You Are Already Using Patterns! A Few Examples;44
6.8;Creating an ASP.NET 5 Application Using MVC 6 and Entity Framework 7;45
6.8.1;Creating a Web Application Using Visual Studio;46
6.8.2;Configuring Project Dependencies;50
6.8.3;Configuring Application Settings;51
6.8.4;Configuring Application Startup;52
6.8.5;Creating DbContext and Model;55
6.8.6;Creating the HomeController;56
6.8.7;Creating the Index and AddContact Views;58
6.8.8;Creating the ContactDb Database;62
6.9;Going Forward: From ASP.NET 5 to ASP.NET Core 1.0;65
6.10;Summary;66
7;Chapter 2: SOLID Principles;67
7.1;Single Responsibility Principle (SRP);67
7.2;Open/Closed Principle (OCP);76
7.3;Liskov Substitution Principle (LSP);83
7.4;Interface Segregation Principle (ISP);96
7.5;Dependency Inversion Principle (DIP);102
7.6;Summary;107
8;Chapter 3: Creational Patterns: Singleton, Factory Method, and Prototype;108
8.1;Overview of Creational Design Patterns;108
8.2;Singleton;109
8.2.1;Design and Explanation;110
8.2.2;Example;110
8.3;Factory Method;115
8.3.1;Design and Explanation;115
8.3.2;Example;116
8.4;Prototype;124
8.4.1;Design and Explanation;124
8.4.2;Example;125
8.4.2.1;Implementing Deep Copy;129
8.5;Summary;130
9;Chapter 4: Creational Patterns: Abstract Factory and Builder;131
9.1;Abstract Factory;131
9.1.1;Design and Explanation;131
9.1.2;Example;132
9.2;Storing Factory Settings;142
9.2.1;Storing Factory Name in the Configuration File;143
9.2.2;Storing Factory Type Name in the Configuration File;144
9.3;Builder;145
9.3.1;Design and Explanation;145
9.3.2;Example;146
9.4;Summary;154
10;Chapter 5: Structural Patterns: Adapter, Bridge, Composite, and Decorator;155
10.1;An Overview of Structural Patterns;155
10.2;Adapter;156
10.2.1;Design and Explanation;156
10.2.2;Example;157
10.2.3;Object Adapter vs. Class Adapter;163
10.3;Bridge;164
10.3.1;Design and Explanation;165
10.3.2;Example;166
10.4;Composite;172
10.4.1;Design and Explanation;173
10.4.2;Example;173
10.5;Decorator;179
10.5.1;Design and Explanation;180
10.5.2;Example;181
10.6;Summary;186
11;Chapter 6: Structural Patterns: Façade, Flyweight, and Proxy;187
11.1;Façade;187
11.1.1;Design and Explanation;188
11.1.2;Example;188
11.2;Flyweight;197
11.2.1;Design and Explanation;198
11.2.2;Example;199
11.3;Proxy;205
11.3.1;Design and Explanation;206
11.3.2;Example;206
11.4;Summary;220
12;Chapter 7: Behavioral Patterns: Chain of Responsibility, Command, Interpreter, and Iterator;221
12.1;Behavioral Patterns;221
12.2;Chain of Responsibility;222
12.2.1;Design and Explanation;222
12.2.2;Example;223
12.3;Command;232
12.3.1;Design and Explanation;232
12.3.2;Example;233
12.4;Interpreter;241
12.4.1;Design and Explanation;241
12.4.2;Example;242
12.5;Iterator;249
12.5.1;Design and Explanation;250
12.5.2;Example;250
12.6;Summary;257
13;Chapter 8: Behavioral Patterns: Mediator, Memento, and Observer;258
13.1;Mediator;258
13.1.1;Design and Explanation;259
13.1.2;Example;260
13.2;Memento;272
13.2.1;Design and Explanation;273
13.2.2;Example;273
13.3;Observer;282
13.3.1;Design and Explanation;283
13.3.2;Example;283
13.4;Summary;292
14;Chapter 9: Behavioral Patterns: State, Strategy, Template Method, and Visitor;293
14.1;State;293
14.1.1;Design and Explanation;294
14.1.2;Example;294
14.2;Strategy;302
14.2.1;Design and Explanation;303
14.2.2;Example;304
14.3;Template Method;310
14.3.1;Design and Explanation;310
14.3.2;Example;311
14.4;Visitor;318
14.4.1;Design and Explanation;319
14.4.2;Example;320
14.5;Summary;326
15;Chapter 10: Patterns of Enterprise Application Architecture: Repository, Unit of Work, Lazy Load, and Service Layer;327
15.1;Overview of P of EAA;327
15.2;Repository;330
15.2.1;Design and Explanation;331
15.2.2;Example;331
15.2.2.1;Creating repositories based on a generic interface;339
15.3;Unit of Work;340
15.3.1;Design and Explanation;340
15.3.2;Example;341
15.4;Lazy Load;348
15.4.1;Design and Explanation;349
15.4.2;Example;350
15.4.2.1;Using .NET Framework's System.Lazy Class;355
15.5;Service Layer;358
15.5.1;Design and Explanation;358
15.5.2;Example;359
15.6;Injecting Repositories Through Dependency Injection;369
15.7;Summary;371
16;Chapter 11: JavaScript Code-Organization Techniques and Patterns;372
16.1;Organizing JavaScript Code Using Objects;372
16.1.1;Object Literals;373
16.1.2;Function Objects;374
16.1.2.1;Function Prototype;375
16.1.3;Immediately Invoked Function Expressions (IIFE);377
16.2;Namespace Pattern;379
16.3;Module Pattern;384
16.4;Revealing Module Pattern;391
16.5;Sandbox Pattern;392
16.6;Using Design Patterns in JavaScript;396
16.6.1;Singleton Pattern;396
16.7;Façade Pattern;398
16.8;Observer Pattern;400
16.9;MVC, MVVM, and MVW Patterns;403
16.10;Summary;406
17;Bibliography;408
18;Index;409




