SlideShare a Scribd company logo
1 of 66
 
Communication Artifacts ,[object Object],[object Object],[object Object],[object Object],[object Object]
Four Keys of Framework Design
Outline
Naming Conventions
Saying It Load
Hungarian Notation ,[object Object],public class CMyClass {   int CompareTo (object objValue) {..}   string lpstrName {get;}   int iValue {get;} }
On Abbreviations, acronym, initialism and the like… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Member Design
Constructors are ,[object Object],[object Object],[object Object],public class XmlFile {  string filename;  Stream data;  public XmlFile(string filename) {   this.data = DownloadData(filename); } } lazy
Properties ,[object Object],[object Object],[object Object],[object Object],public class ArrayList {  public int Count {get;} }
Properties versus Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EmployeeList l = FillList(); for (int i = 0; i < l.Length; i++){ if (l.All[i] == x){...} } public Employee[] All {get{}} Moral: Use method if the operation is expensive  Calling Code Properties and returning arrays
Extension Methods
   CONSIDER  using extension methods to &quot;add&quot; methods to interfaces
   CONSIDER  using extension methods to manage dependencies Uri uri =  “ftp://some.ftp.uri”.ToUri();  // higher level assembly (not mscorlib)  namespace System.Net { public static class StringExtensions{ public static Uri ToUri(this string s){ … }  }  }
   AVOID  frivolously defining extension methods, especially on types you don’t own  ,[object Object],[object Object],[object Object],[object Object]
   AVOID  defining extension methods on System.Object
Type Design
Start Run
 
What we ship: Too much and not enough…
 
Abstract and Base classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Virtual Methods ,[object Object],[object Object],[object Object],[object Object],[object Object]
Overriding Methods ,[object Object],[object Object],[object Object],[object Object]
To Virtual Or Not Virtual … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Barbara Liskov
Interfaces ,[object Object],[object Object],[object Object],[object Object],[object Object],public interface IComparable {   int CompareTo(object obj); }
  
 
Libraries , Primitives, Abstractions
   CONSIDER  placing library types higher on the dependency stack  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
   DO   keep primitives policy free (i.e. simple) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Trends
Test Driven Development ,[object Object],[object Object]
Heavy Dependencies & Testability
Inversion of Control // your better API public  abstract class TraceListener  { public abstract void Trace(string message); }  public class Tracer { TraceListener listener; public Tracer( TraceListener listener ){ this.listener = listener; } public void Trace(string message){  listener.Trace(message); } }
Dependency Injection Check Containers like: Spring.NET, Castle Windsor , Structuremap, , Unity … MEF session tomorrow will talk about it (isA)
The Power of Sameness ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The perilous summit of complexity  by example
How do I read all the lines from a file?
VS7 Era “ IO” seems like a reasonable place to start
Why did they make it inaccessible Backup, and try again…
Open.. Looks like a good first step…
Hmm… OK, what do I do with a FileStream?
Ok good, synchronous and asynchronous operations.. What the heck is that?
I think I am in the wrong place..
Back up, let’s try a different type
Ahh, ReadLine(), this looks more promising..
OK, How do you find the end?
Thanks goodness there was a sample
The pit of success way ,[object Object]
Just what I need…
Ah, a string[] I know just what to do with that…
How simple!
Tools
Framework Design Tools
 
 
 
 
 
 
Make the simple things simple and the hard things possible
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Type checking
Type checkingType checking
Type checking
rawan_z
 
1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]
Hardik Patel
 
Rinke Owl Uml 20040428
Rinke Owl Uml 20040428Rinke Owl Uml 20040428
Rinke Owl Uml 20040428
Rinke Hoekstra
 

What's hot (20)

OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Type checking
Type checkingType checking
Type checking
 
1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]
 
Java se 8 fundamentals
Java se 8 fundamentalsJava se 8 fundamentals
Java se 8 fundamentals
 
Is Java seen as a pure object-oriented language or not?
Is Java seen as a pure object-oriented language or not?Is Java seen as a pure object-oriented language or not?
Is Java seen as a pure object-oriented language or not?
 
Mit4021 c# and .net
Mit4021   c# and .netMit4021   c# and .net
Mit4021 c# and .net
 
Javanotes
JavanotesJavanotes
Javanotes
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)Advanced Programming _Abstract Classes vs Interfaces (Java)
Advanced Programming _Abstract Classes vs Interfaces (Java)
 
Coding standard and coding guideline
Coding standard and coding guidelineCoding standard and coding guideline
Coding standard and coding guideline
 
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
What is Interface in Java | How to implement Multiple Inheritance Using Inter...What is Interface in Java | How to implement Multiple Inheritance Using Inter...
What is Interface in Java | How to implement Multiple Inheritance Using Inter...
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Style & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & StructureStyle & Design Principles 01 - Code Style & Structure
Style & Design Principles 01 - Code Style & Structure
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Type Systems
Type SystemsType Systems
Type Systems
 
Control statements
Control statementsControl statements
Control statements
 
What To Expect With C
What To Expect With CWhat To Expect With C
What To Expect With C
 
Rinke Owl Uml 20040428
Rinke Owl Uml 20040428Rinke Owl Uml 20040428
Rinke Owl Uml 20040428
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Effective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All ObjectsEffective Java - Chapter 3: Methods Common to All Objects
Effective Java - Chapter 3: Methods Common to All Objects
 

Viewers also liked

Chapter 5 - Retail Market Strategy
Chapter 5 - Retail Market StrategyChapter 5 - Retail Market Strategy
Chapter 5 - Retail Market Strategy
Becky Campbell
 

Viewers also liked (6)

Scrum For Developers
Scrum For DevelopersScrum For Developers
Scrum For Developers
 
Ways To Increase Revenue & Cutting Cost Using Retail CRM
Ways To Increase Revenue & Cutting Cost Using Retail CRMWays To Increase Revenue & Cutting Cost Using Retail CRM
Ways To Increase Revenue & Cutting Cost Using Retail CRM
 
Introduction Professional Scrum Developer for Java
Introduction Professional Scrum Developer for JavaIntroduction Professional Scrum Developer for Java
Introduction Professional Scrum Developer for Java
 
CRM in Retail Industry (การบริหารความสัมพันธ์กับลูกค้า สำหรับธุรกิจค้าปลีก)
CRM in Retail Industry (การบริหารความสัมพันธ์กับลูกค้า สำหรับธุรกิจค้าปลีก)CRM in Retail Industry (การบริหารความสัมพันธ์กับลูกค้า สำหรับธุรกิจค้าปลีก)
CRM in Retail Industry (การบริหารความสัมพันธ์กับลูกค้า สำหรับธุรกิจค้าปลีก)
 
Chapter 5 - Retail Market Strategy
Chapter 5 - Retail Market StrategyChapter 5 - Retail Market Strategy
Chapter 5 - Retail Market Strategy
 
The 2017 Content Marketing Framework
The 2017 Content Marketing FrameworkThe 2017 Content Marketing Framework
The 2017 Content Marketing Framework
 

Similar to Framework Design Guidelines

C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Features
techfreak
 

Similar to Framework Design Guidelines (20)

Framework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users GroupFramework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users Group
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your Code
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Features
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real WorldBack-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: .NET Coding Standards For The Real World
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
C# interview-questions
C# interview-questionsC# interview-questions
C# interview-questions
 
Form Follows Function
Form Follows FunctionForm Follows Function
Form Follows Function
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
C# interview
C# interviewC# interview
C# interview
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Csci360 20 (1)
Csci360 20 (1)Csci360 20 (1)
Csci360 20 (1)
 
Csci360 20
Csci360 20Csci360 20
Csci360 20
 
CLR Exception Handing And Memory Management
CLR Exception Handing And Memory ManagementCLR Exception Handing And Memory Management
CLR Exception Handing And Memory Management
 
Suga java training_with_footer
Suga java training_with_footerSuga java training_with_footer
Suga java training_with_footer
 
Functional Programming In Jdk8
Functional Programming In Jdk8 Functional Programming In Jdk8
Functional Programming In Jdk8
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Python
 

More from Mohamed Meligy

DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor Session
Mohamed Meligy
 
Twitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET CodeTwitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET Code
Mohamed Meligy
 

More from Mohamed Meligy (7)

NDC Sydney 2018 Ngrx
NDC Sydney 2018   NgrxNDC Sydney 2018   Ngrx
NDC Sydney 2018 Ngrx
 
DDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor SessionDDD Sydney 20111 Razor Session
DDD Sydney 20111 Razor Session
 
Twitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET CodeTwitter OAuth With C#/.NET Code
Twitter OAuth With C#/.NET Code
 
Using jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms WorldUsing jQuery To Survive In ASP.NET Webforms World
Using jQuery To Survive In ASP.NET Webforms World
 
Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)Managed Extensibility Framework (MEF)
Managed Extensibility Framework (MEF)
 
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVCApplying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
Applying Domain Driven Design on Asp.net MVC – Part 1: Asp.net MVC
 
Design Patterns Via C# 3.0
Design Patterns Via C# 3.0Design Patterns Via C# 3.0
Design Patterns Via C# 3.0
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Framework Design Guidelines