Documente Academic
Documente Profesional
Documente Cultură
Structural
Patterns that focus on the relationships
between entities.
Behavioral
Patterns that focus on the communication
patterns between objects.
Concurrency
Patterns that deal with multi-threaded
programming techniques.
The Interface
What is it?
An interface contains only the signatures of
methods, properties, events or indexers.
It is a contract between you and the rest of
the world.
1 week later
Can we have third party authored
documents about us in our system?
This is
dangerous!
1 day later
Can we have patient related documents
for the procedures we have done or have
found on-line?
if (doc is IMedicalDocument)
{
// Do medical stuff...
}
if (doc is IPhysicianDocument)
{
// Do physician stuff...
}
The Singleton
The Factory
What
The factory
pattern
is ahelp
creational
are
common
uses
for apattern
doessome
the
factory
with?
Returning
that
uses a Interface
singleton
object to provide
factory?
implementations
Logging
implementations
of object
a requested
Simplifies complex
creation interface
a
to
caller.
Configuration
Caching
Data access
Testing
uses
DAOFactoryConfiguration
+GetTypeName(in key : string) : string
+SetTypeName(in key : string, in typeName : string)
Create fake
implementations
instead of
waiting
Test really
hard
scenarios
The Delegate
What
are
common
uses
for a
The delegate
doessome
thepattern
delegate
is ahelp
technique
with?
Separation
delegate?
where
an object
expresses certain
of concerns
Data
behavior,
in reality
Reuseaccess
ofbut
common
logicdelegates the
Business layer
responsibility
fordelegates
implementing/executing
Asynchronous
that
behavior toprogramming
an associated object.
A Common Problem
How should I instrument my code?
The real problems are
What should I capture?
Where should I store the captured data?
Who should I notify when things go bad?
What does bad mean?
How do I change the system behavior to
optimize the system resources that are
available to me?
How do I keep my code clean???
A Common Solution
public void Execute()
{
DateTime startedOn = DateTime.UtcNow;
Logger logger = new Logger();
try
{
logger.Write(string.Format(
"Starting GetPerson([{0}]) at {1}", m_modelId, DateTime.UtcNow));
// Execute call
logger.Write(string.Format(
"Finished GetPerson([{0}]) at {1} and it worked!",
m_modelId, DateTime.UtcNow));
}
catch (Exception e)
{
logger.Write(string.Format("GetPerson([{0}]) failed {1}.", m_modelId, e));
throw;
}
finally
{
DateTime endedOn = DateTime.UtcNow;
TimingSystem.GetInstance().LogExecutionTime("GetPerson", endedOn.Subtract(startedOn));
}
}
Interceptor Implementations
SOA - Simplified
A simplistic view of one service
Why do you
have all of
these layers?
What is a
model?
Proper Coupling
Is this
allowed?
Bad SOA!
Database Coupling
What if an
account is
removed?
Questions
Future Topics
Unit Testing
SOA Deep Dive
Pub / Sub
Business Intelligence / Analytics
Free Text Search