23
Component Based Software Development Diego Cardozo github.com/diegocard

Component Based Software Development

Embed Size (px)

DESCRIPTION

Talk on component based software development, presented in the eight Uruguayan .NET Meetup.

Citation preview

Page 1: Component Based Software Development

ComponentBasedSoftwareDevelopment

DiegoCardozo

github.com/diegocard

Page 2: Component Based Software Development

Agenda1. Motivation2. ¿WhatisCBSD?3. ComponentsvsObjects4. Wellknownapplications5. ¿HowdoCMSsfitin?6. Applyingthseconcepts

WebMatrixOrchardCMS

Warning:thistalkisaboutSoftwareEngineering

Page 3: Component Based Software Development

Motivation(1)IfGMhadkeptupwithtechnologylikethecomputerindustryhas,wewouldallbedriving$25.00carsthatgot1,000miles

tothegallon.

Page 4: Component Based Software Development

Motivation(2)Butyouwould...

Crashatleast2timesadayHavetobuyanewcareverytimeanewtrafficsignalisinstalledHavetolearntodriveagaineverytimeyoubuyanewmodel

Page 5: Component Based Software Development

¿Conclusion?OtherindustriesfollowdifferentapproachesTheygetverygoodresultsinareaswerewedon't.

Carindustry:agileprocess,complexproductthatisbuiltrapidly.Constructionindustry:muchhighercostassociatedtochange,buttheyanticipateitbetter.

¿Whatdootherindustrieshaveincommon?

Page 6: Component Based Software Development

TheyworkusingcomponentsHigherre-userateSimplifiestestingSimplifiesmaintenanceBetteroverallquality

Componentsdevelopedbythirdparties

ShorterdevelopmentcycleBetterROI

Page 7: Component Based Software Development

¿WhatisaSWcomponent?"Asoftwarecomponentisaunitofcompositionwithcontractuallyspecifiedinterfaceandexplicitcontext

dependenciesonly.Asoftwarecomponentcanbedeployedindependentlyandis

subjecttocompositionbythirdparts."

Szyperski,2002

Page 8: Component Based Software Development

7Criteria1. CanbeusedbyotherSWcomponents2. Canbeusedbyotherswithouttheinterventionofthe

authoringdeveloper(LikeCMS).3. Includesspecificationsforallofitsdependencies.4. Includesdocumentationofalltheofferedfunctionalities.5. Itsbehaviorcanbeunderstoodfromitsspecifications.6. Canbecoupledtoothercomponents.7. CanbeincorporatedtoaSWsystemrapidlyandsmoothly.

Page 9: Component Based Software Development

DisadvantagesClairvoyance:designacomponentwithoutknowledgeofitsfinaluser.Customization:itishardtocustomizeacomponentwithoutaccesstoitsimplementation.Lackofsupport:onceacomponentiscreatedandsealed,¿whomaintainsitandhow?

Page 10: Component Based Software Development

ObjectsvsComponentsObject Component

Polymorphism Yes No

Instantiation Late Aslateaspossible

Encapsulation Sortof Realandenforced

Inheritance Si Interfaceinheritanceandbinaryreuse

Page 11: Component Based Software Development

WellknownapplicationsLowlevel:COM(ComponentObjectModel)

Processcommunicationindifferentlanguages.NETprecursor

CORBAStandardcreatedbyOMGWidelyusedintheJavaworld

OtherapplicationsProgrammingforgraphicdesign

Page 12: Component Based Software Development

Paintermodel(1)

Page 13: Component Based Software Development

Paintermodel(2)Thereare2techniquestocreateimagesOneofthemisthepaintermodelYoutakeanelement(brush,pencil)anduseittocreateimagesfromscratch.Freestrokesareused.Naturalapproach.Ibelieveitistheperfectanalogyforhowwedevelopsoftware. 1. Webeginwithablankpage.2. Imaginetheproductasifitwerefinished.3. Implementthesolutionlinebyline.

Page 14: Component Based Software Development

Compositionmodel(1)

Page 15: Component Based Software Development

Compositionmodel(2)Itisaboutcreatingimagesfromexistingelements.Example:mosaicExample:drawachessboard.Ibelievethisistheapproachwemustfollowwhencreatingsoftware. 1. Takeknownandwelldefinedelements.2. Putthemtogetherinasmartway.3. Createonlythemissingcomponents.

Thereisanenormousamountofexistingcomponentsintheworldofsoftware.

Page 16: Component Based Software Development

PaintervscompositionOnemethodcanbefasterthantheother,dependingonthetypeofimageinvolved.Alsoconsiderwhichoneachievesabetterresult.Nevertheless,Ibelievethatmostproblemsinthesoftwareworldadjustbettertothecompositionmodel.

Page 17: Component Based Software Development

Enoughphilosophy...Concreteexample:

CreateawebsitefortheUruguayan.NETcommunityIncludeaforum

¿WhyuseaCMS?

TheyarefundamentallybasedaroundCBSD.Bothstructureandcontentaretreatedascomponents

Pages,images,posts,widgets,modules,etc.Hugecommunityandcomponentcatalogavailable.

Page 18: Component Based Software Development

MicrosoftWebMatrix(1)FreedevelopmentenvironmentbyMicrosoftLightweight:40MBoutoftheboxcomparedtoseveralGBfromVisualStudioDesignedforthecloudHandlesmanylanguagesandframeworks

ASP.NETPHPNode.js

IntegrateswithconGITandTFS

Page 19: Component Based Software Development

MicrosoftWebMatrix(2)VisualStudiofeelslikealaboratoryforcreatingsoftwareWebMatrixisidealforDSBC

Providescomponents:FrameworkgalleryIncorporatesNuGetpackagemanagerUsefulextensions

Isolatesframeworkfromcomponents

Page 20: Component Based Software Development

OrchardCMS(1)CompletelyOpenSourceRapidgrowthMVCArchitectureThismeansthatallcomponentsfollowaMVCarchitecture.

CreatingnewcomponentsissimpleComponentsareeasytounderstandandextend

Page 21: Component Based Software Development

OrchardCMS(2)Components

ContentModule

FeaturesThemesTemplates

ShapesWidgetsUsers,roles,permissions

Page 22: Component Based Software Development

ResourcesSlidesandcode:

github.com/diegocard/CBSD-presentationCBSDinMSDN(spanish):

http://msdn.microsoft.com/es-es/library/bb972268.aspx#ref07back

Greatrelatedpresentation(spanish):http://www.slideshare.net/ulicruz/desarrollo-de-software-basado-en-componentes

PaperComponent-BasedSoftwareEngineering–NewParadigmofSoftwareDevelopment(Crnkovic,Larsson)

Page 23: Component Based Software Development

Theend"Ithasbeenalongtimeincoming,buttheIndustrial

Revolutionofsoftwareisfinallyuponus.Specializationofresources,standardsforinterchangeableparts,andstreamlinedassemblytoolshavebeenusedinother

industriesforhundredsofyearstospeedthedevelopmentofhighlycomplexproducts.

Despitetheirubiquity,applicationoftheseconceptstothemodernsoftwareindustryisjustbeginning.."

BillGates,1997