Say what you will Say what you will say and listen to say and listen to what you will listen what you will listen to … to … About the importance of About the importance of contracts and metadata… contracts and metadata… Clemens Vasters, newtelligence Clemens Vasters, newtelligence AG AG [email protected][email protected]
47
Embed
Say what you will say and listen to what you will listen to … About the importance of contracts and metadata… Clemens Vasters, newtelligence AG [email protected].
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Say what you will say Say what you will say and listen to what you and listen to what you will listen to …will listen to …
About the importance of contracts About the importance of contracts and metadata…and metadata…
Clemens Vasters, newtelligence AGClemens Vasters, newtelligence [email protected]@newtelligence.com
Thinking about dataThinking about data Thinking about typesThinking about types Thinking about passing typed dataThinking about passing typed data Thinking about exchanging dataThinking about exchanging data Thinking about behaviors around Thinking about behaviors around
datadata
How is this relevant to today’s How is this relevant to today’s launch event?launch event?
Elements of Agreement Elements of Agreement (Step 1)(Step 1) NameName: Common understanding of : Common understanding of
names for data elements and their names for data elements and their interpretationinterpretation
LocationLocation: Common understanding of : Common understanding of (relative) location of data inside a (relative) location of data inside a contextcontext
Type:Type: Common understanding of Common understanding of persistent or transient persistent or transient representation of data elementsrepresentation of data elements
Data:Data: Representation of information Representation of information under agreement on name, location under agreement on name, location and type.and type.
How about How about implementation?implementation? Sorry, we can't reach agreement on Sorry, we can't reach agreement on
that ...that ... Implementation realizes requirements Implementation realizes requirements
in the scope of a (sub-)system contextin the scope of a (sub-)system context How do you agree on implementation How do you agree on implementation
across applications, frameworks and across applications, frameworks and languages; organizations and software languages; organizations and software suppliers?suppliers?
Impl. agreement contradicts Impl. agreement contradicts modularitymodularity Same behavior of data for all tiers and Same behavior of data for all tiers and
layers?layers? Same behavior of data for all modules?Same behavior of data for all modules? Same behavior of data for all Same behavior of data for all
We can agree on data, types and We can agree on data, types and location.location.
We can't agree on implementation.We can't agree on implementation.
Data can be exchangedData can be exchanged Implementation cannotImplementation cannot
Conclusion: Conclusion: Trying to agree on data and Trying to agree on data and implemen-tation (aka. "objects") implemen-tation (aka. "objects") might be a problem.might be a problem.
string FirstName =string FirstName ="This is a very long string "This is a very long string which will likely not fit into which will likely not fit into your database, because the your database, because the database field for this element database field for this element does only allow 40 characters does only allow 40 characters to be stored and this is easily to be stored and this is easily longer";longer";
Strings: Bounded sequences of Strings: Bounded sequences of characters,characters,Integers: Bounded, integral numbers,Integers: Bounded, integral numbers,Floats: Bounded, floating point Floats: Bounded, floating point numbersnumbers
Agreement on storage rules is still Agreement on storage rules is still scoped: CLR, XML, JVM, SPARC, IA64, scoped: CLR, XML, JVM, SPARC, IA64, IA32IA32
Agreeing on types is hard Agreeing on types is hard (2/2)(2/2) Can't agree on implemented Can't agree on implemented
behavior, but on rules for behaviorbehavior, but on rules for behavior 1 + 1 = 21 + 1 = 2 "1"+"1"="11""1"+"1"="11" 2003-02-29 bad, 2004-02-29 good2003-02-29 bad, 2004-02-29 good FirstName: minLength=1, FirstName: minLength=1,
maxLength=40, pattern="\p{L}+"maxLength=40, pattern="\p{L}+" Particular record may only appear once Particular record may only appear once
in a sequence (uniqueness)in a sequence (uniqueness)
There's versioning built into XML There's versioning built into XML SchemaSchema It's so useful that you shouldn't use It's so useful that you shouldn't use
it.it. How can users tell looking at How can users tell looking at
instances?instances? Proper use is:Proper use is:
Import into new namespace and Import into new namespace and extension/restrictionextension/restriction
Replacement with new schema with Replacement with new schema with different namespacedifferent namespace
Design to extend using <any/>Design to extend using <any/>
DOM, DataSets and DOM, DataSets and SerializationSerialization XmlDocument: Hierarchical prog. XmlDocument: Hierarchical prog.
modelmodel DataSet: Relational prog. modelDataSet: Relational prog. model Serialization: OO prog. ModelSerialization: OO prog. Model
All those map from and to the All those map from and to the InfoSetInfoSet
Type system for InfoSet is SchemaType system for InfoSet is Schema Allows validation of data for correctnessAllows validation of data for correctness Allow generation of code enforcing rulesAllow generation of code enforcing rules
XSD.EXEXSD.EXE Generates classes from SchemaGenerates classes from Schema
Turns complexType into classes Turns complexType into classes Translates enumeration restrictions into Translates enumeration restrictions into
enumsenums Doesn't enforce other restriction facetsDoesn't enforce other restriction facets
Generates DataSets from SchemaGenerates DataSets from Schema Turns complexType into tablesTurns complexType into tables Turns "complexTypes in complexTypes" into Turns "complexTypes in complexTypes" into
relations between tablesrelations between tables Enforces length restriction facets Enforces length restriction facets
Also generates schema from classesAlso generates schema from classes Good start point, but that's itGood start point, but that's it
Contracts: Promises and Contracts: Promises and TrustTrust Contracts between endpoints …Contracts between endpoints …
Are promises and guarantees to deliver stuff Are promises and guarantees to deliver stuff (and how)(and how)
Are promises and guarantees to accept stuff Are promises and guarantees to accept stuff (and how)(and how)
Contract parts in Web ServicesContract parts in Web Services XSD: Data typesXSD: Data types WSDL/XSD: MessagesWSDL/XSD: Messages WSDL/BPEL4WS: Message exchange patternsWSDL/BPEL4WS: Message exchange patterns WS-Policy: Quality of service rules and req’sWS-Policy: Quality of service rules and req’s
Contract parts in Enterprise ServicesContract parts in Enterprise Services Metadata/IDL: Data types, messages, exchange Metadata/IDL: Data types, messages, exchange
patternspatterns Config/Negotiation: Quality of service rules and Config/Negotiation: Quality of service rules and
OOA & OOD in a Services OOA & OOD in a Services WorldWorld Analyze data and behavior Analyze data and behavior
requirementsrequirements OOA is a OOA is a Good ThingGood Thing
Design data, not "objects"Design data, not "objects" OOD design that yields "business OOD design that yields "business
objects" is a questionable thing to do.objects" is a questionable thing to do. Designing data and context-appropriate Designing data and context-appropriate
behavior ("services") is a behavior ("services") is a Good ThingGood Thing There is no easy path from OOA to There is no easy path from OOA to
OOD if you want to build a scalable, OOD if you want to build a scalable, distributed system of services.distributed system of services.
XmlValidatingReaderXmlValidatingReader XmlValidatingReader is a good friendXmlValidatingReader is a good friend
Direct or as reader for XmlDocumentDirect or as reader for XmlDocument Validates instances using Schema Validates instances using Schema
collectionscollections Enforces all facets of type restrictionsEnforces all facets of type restrictions Enforces contractsEnforces contracts
Validation is an "edge service" like Validation is an "edge service" like authenticationauthentication Can't trust incoming data, must verify Can't trust incoming data, must verify
outbound dataoutbound data You pay performance tax, but it's worth the You pay performance tax, but it's worth the
On the edge:On the edge:ASMX & Enterprise ServicesASMX & Enterprise Services IIS 6.0 and ASP.NET Web Services IIS 6.0 and ASP.NET Web Services
(ASMX)(ASMX) Application infrastructure for Application infrastructure for
implementing public interfaces for "far implementing public interfaces for "far tiers"tiers"
Highly optimized for HTTP traffic, Highly optimized for HTTP traffic, appropriate process model for Web appropriate process model for Web ServicesServices
Windows Enterprise ServicesWindows Enterprise Services Application infrastructure for Application infrastructure for
implementing services for "near tiers"implementing services for "near tiers" Most appropriate process model for Most appropriate process model for
implementing robust, available implementing robust, available backendsbackends
ASMX and Enterprise Services are a ASMX and Enterprise Services are a teamteam