Muutke küpsiste eelistusi

AOP in .NET [Pehme köide]

  • Formaat: Paperback / softback, 275 pages, kõrgus x laius x paksus: 233x190x18 mm, kaal: 502 g
  • Ilmumisaeg: 27-Jun-2013
  • Kirjastus: Manning Publications
  • ISBN-10: 1617291145
  • ISBN-13: 9781617291142
Teised raamatud teemal:
  • Pehme köide
  • Hind: 53,19 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 275 pages, kõrgus x laius x paksus: 233x190x18 mm, kaal: 502 g
  • Ilmumisaeg: 27-Jun-2013
  • Kirjastus: Manning Publications
  • ISBN-10: 1617291145
  • ISBN-13: 9781617291142
Teised raamatud teemal:
Presents an introduction to aspect-oriented programming offering real-world examples that concentrate on modularizing non-fuctional requirements.

Summary

AOP in .NET introduces aspect-oriented programming to .NET developers and provides practical guidance on how to get the most benefit from this technique in your everyday coding. The book's many examples concentrate on modularizing non-functional requirements that often sprawl throughout object-oriented projects. Even if you've never tried AOP before, you'll appreciate the straightforward introduction using familiar C#-based examples. AOP tools for .NET have now reached the level of practical maturity Java developers have relied on for many years, and you'll explore the leading options, PostSharp, and Castle DynamicProxy.

About the Technology

Core concerns that cut across all parts of your application, such as logging or authorization, are difficult to maintain independently. In aspect-oriented programming (AOP) you isolate these cross-cutting concerns into their own classes, disentangling them from business logic. Mature AOP tools like PostSharp and Castle DynamicProxy now offer .NET developers the level of support Java coders have relied on for years.

About this Book

AOP in .NET introduces aspect-oriented programming and provides guidance on how to get the most practical benefit from this technique. The book's many examples concentrate on modularizing non-functional requirements that often sprawl throughout object-oriented projects. You'll appreciate its straightforward introduction using familiar C#-based examples.

This book requires no prior experience with AOP. Readers should know C# or another OO language.

What's Inside

  • Clear and simple introduction to AOP
  • Maximum benefit with minimal theory
  • PostSharp and Castle DynamicProxy

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Author

Matthew D. Groves is a developer with over ten years of professional experience working with C#, ASP.NET, JavaScript, and PHP.

Table of Contents

    PART 1 GETTING STARTED WITH AOP
  1. Introducing AOP
  2. Acme Car Rental
  3. PART 2 THE FUNDAMENTALSOF AOP
  4. Call this instead: intercepting methods
  5. Before and after: boundary aspects
  6. Get this instead: intercepting locations
  7. Unit testing aspects
  8. PART 3 ADVANCED AOP CONCEPTS
  9. AOP implementation types
  10. Using AOP as an architectural tool
  11. Aspect composition: example and execution
Foreword xiii
Preface xv
Acknowledgments xvii
About this book xix
Part 1 Getting Started With AOP 1(52)
1 Introducing AOP
3(18)
1.1 What is AOP?
4(10)
Features
4(4)
Benefits
8(5)
AOP in your daily life
13(1)
1.2 Hello, World
14(5)
1.3 Summary
19(2)
2 Acme Car Rental
21(32)
2.1 Start a new project
22(2)
Business requirements
23(1)
Necessary nonfunctional requirements
24(1)
2.2 Life without AOP
24(19)
Write the business logic
25(3)
Testing the business logic
28(1)
Add logging
29(2)
Introducing defensive programming
31(1)
Working with transactions and retries
32(3)
Handling exceptions
35(3)
Refactor without AOP
38(5)
2.3 The cost of change
43(2)
Requirements will change
43(1)
Small versus large projects
43(1)
Signature changes
44(1)
Working on a team
45(1)
2.4 Refactor with AOP
45(7)
Start simple and isolate the logging
45(2)
Refactor defensive programming
47(2)
Creating an aspect for transactions and retries
49(1)
Put exception handling into its own class
50(2)
2.5 Summary
52(1)
Part 2 The Fundamentals of AOP 53(116)
3 Call this instead: intercepting methods
55(24)
3.1 Method interception
56(7)
PostSharp method interception
57(3)
Castle DynamicProxy method interception
60(3)
3.2 Real-world example: data transactions
63(7)
Ensuring data integrity with begin and commit
63(4)
When transactions go bad: rollback
67(1)
When all else fails, retry
67(3)
3.3 Real-world example: threading
70(7)
The basics of .NET threading
70(1)
UI threads and worker threads
71(3)
Declarative threading with AOP
74(3)
3.4 Summary
77(2)
4 Before and after: boundary aspects
79(36)
4.1 Boundary aspects
80(12)
PostSharp method bounding
80(3)
Method boundaries versus method interception
83(5)
ASP.NET HttpModule bounding
88(4)
4.2 Real-world example: detecting mobile users
92(8)
Offer a link to an application
93(6)
Don't be a pest
99(1)
4.3 Real-world example: caching
100(14)
ASP.NET Cache
102(1)
An application that could benefit from caching
103(5)
Caching a result
108(2)
Retrieving from the cache
110(3)
A more robust cache key
113(1)
4.4 Summary
114(1)
5 Get this instead: intercepting locations
115(26)
5.1 Location interception
116(3)
Fields and properties in .NET
116(2)
PostSharp location interception
118(1)
5.2 Real-world example: lazy loading
119(9)
Lazy loading approaches in .NET
120(1)
Implementing lazy loading with AOP
121(3)
What about lazy-loading fields?
124(4)
5.3 Real-world example: INotifyPropertyChanged
128(10)
Using INotifyPropertyChanged in a desktop application
128(4)
Problems and constraints with INotifyPropertyChanged
132(2)
Reducing boilerplate with AOP
134(4)
5.4 Summary
138(3)
6 Unit testing aspects
141(28)
6.1 Writing tests with NUnit
142(5)
Writing and running NUnit tests
142(3)
Testing strategies for aspects
145(2)
6.2 Castle DynamicProxy testing
147(9)
Testing an interceptor
147(2)
Injecting dependencies
149(7)
6.3 PostSharp testing
156(12)
Unit testing a PostSharp aspect
157(1)
Injecting dependencies
158(4)
Problems with PostSharp and testing
162(6)
6.4 Summary
168(1)
Part 3 Advanced AOP Concepts 169(74)
7 AOP implementation types
171(20)
7.1 How does AOP work?
172(1)
7.2 Runtime weaving
172(11)
Proxy pattern revisited
173(3)
Dynamic proxies
176(7)
7.3 Compile-time weaving
183(5)
Postcompiling
184(1)
Before and after
184(4)
7.4 Runtime versus compile-time weaving
188(2)
Pros of runtime weaving
189(1)
Pros of compile-time weaving
189(1)
7.5 Summary
190(1)
8 Using AOP as an architectural tool
191(22)
8.1 Compile-time initialization and validation
192(7)
Initializing at compile time
193(2)
Validating the correct use of an aspect
195(2)
Real-world example: Threading revisited
197(2)
8.2 Architectural constraints
199(6)
Enforcing architecture
200(3)
Real-world example: NHibernate and virtual
203(2)
8.3 Multicasting
205(6)
At the class level
206(4)
At the assembly level
210(1)
8.4 Summary
211(2)
9 Aspect composition: example and execution
213(30)
9.1 Using multiple aspects
214(1)
9.2 Aspect roles with PostSharp
215(4)
PostSharp aspect roles
217(1)
Role dependencies
217(2)
9.3 Composing aspects with DynamicProxy
219(5)
Ordering aspects
219(3)
Reducing repetition with custom conventions
222(2)
9.4 Real-world example: caching and authorization
224(17)
Application architecture
225(7)
PostSharp
232(4)
Castle DynamicProxy
236(5)
9.5 Summary
241(2)
Appendix A Ecosystem of .NET AOP tools 243(14)
Appendix B NuGet basics 257(8)
Index 265
AUTHOR BIO

 





Matthew D. Groves is a developer with over 10 years of professional experience in education, consulting, and product development. He concentrates on web applications, using C# with ASP.NET, JavaScript, and PHP.