Prism – Composite Application Guidance

3y ago
54 Views
4 Downloads
422.81 KB
17 Pages
Last View : 12d ago
Last Download : 3m ago
Upload by : Melina Bettis
Transcription

9/16/2010Prism – Composite ApplicationGuidanceBrian Noyeswww.idesign.net 2010 Brian Noyes, IDesign Inc. All rights reservedPrism Developed by Microsoft patterns and practicesOld name: Composite Application Guidance for WPF and SilverlightGuidance for building composite applications Loosely coupled, modular applications Patterns-based documentation, samples, re-usable codeDesigned as a successor to CAB/SCSF for WPFGeneral design goals: Light weight – use any combination of features Use any container Strong typing 2010 Brian Noyes, IDesign Inc. All rights reserved1

9/16/2010Prism Consists of: Prism Library Thelibrary formerly known as CALStock Trader Reference Implementation (RI) Quickstarts Documentation How-TosCurrent Released Version: 2.2 prism.codeplex.com Prism Version History Prism 1 – June 2008 – WPF OnlyPrism 2 – Feb 2009 – Added support for Silverlight 3Prism 2.1 – October 2009 – Minor updatePrism 2.2 – July 2010 – Updated for .NET 4 / Silverlight 4Prism 4 – October 2010 – MVVM / MEF / Navigation added 2010 Brian Noyes, IDesign Inc. All rights reserved2

9/16/2010Prism 4 Almost complete (feature complete end of September)Expected release October 2010Public Drops Release 1 CTP already available prism.codeplex.comMain focus areas: MVVM Guidance MEF container support Navigation guidanceWhy Composites? Good design – based on well known design patternsLoose couplingSeparation of concernsEnd goal: Maintainability Extensibility Testability etc 2010 Brian Noyes, IDesign Inc. All rights reserved3

9/16/2010Prism Key Features Modularity Compose application of loosely coupled units of functionalityUI Composition Compose the user interface of loosely coupled UI partsCommunications Loosely coupled communications with events and commandsApp structure Well defined abstractions for different kinds of presentation layer code Model-View-ViewModel, Application Controller, Bootstrapper, Modules, etcNavigation Well defined approach for switching and navigating through differentviews/screens in the applicationPrism Application Architecture Prism LibraryShell Application Bootstrapper Shell Shared resourcesModules Views / ViewModels Controllers Services 2010 Brian Noyes, IDesign Inc. All rights reserved4

9/16/2010Bootstrapper Startup code for your applicationAlternative to putting everything in the Main() method / AppclassWell defined intialization point in your applicationNot required, but recommendedDerive from UnityBootstrapper or MefBootstrapperBootstrapping Process 2010 Brian Noyes, IDesign Inc. All rights reserved5

9/16/2010Shell Main window of the applicationCould be more than onePresented at startup (typically, could be minimized to SystemTray)Root element for the whole UI Typically knows nothing about the views that it is composed of Even modular views that know nothing about the shellJust provides a “shell” to contain them, thus the nameMay define regions for dynamic plug in of viewsMay explicitly load views into containers in the UIShell Implementation Just a normal Silverlight UserControl or WPF WindowSet as RootVisual in Silverlight, Application.MainWindow inWPFDefines the overall layout for the applicationMay contribute styles and templates that flow down to child viewthrough resourcesAdd regions for views to be added by modules 2010 Brian Noyes, IDesign Inc. All rights reserved6

9/16/2010Views Composite parts (Legos) of your UIUsed to decompose your window from one big monolithic blobinto a bunch of semi-autonomous partsCan be defined as: User controlCustom controlSilverlight Data TemplateXAML ResourceDynamically constructed UI Element treeUltimately in Silverlight and WPF: A UIElement with some backing logicViews 2010 Brian Noyes, IDesign Inc. All rights reserved7

9/16/2010Services Common abstraction in compositesDoes not (typically) mean Web or WCF services Application (in-proc) service might be point of encapsulationfor the proxy that calls an external serviceProvide shared services across the application Modules and shellTypically singleton instance modelContainer provides the glueServices Prism Provided: LoggingRegion ManagerEvent AggregatorModule CatalogModule ManagerNavigation Service (Prism 4)Custom Entity data servicesAuthenticationCaching 2010 Brian Noyes, IDesign Inc. All rights reserved8

9/16/2010Modules Unit of composition for the application Modules contain the artifacts for a portion of your application As opposed to views as the unit of composition for the UISelf-containedDecoupledReusableTypically defined as a Visual Studio project / assemblyCan have more than one module per assembly AvoidModules Module class: Initialize the objects in the moduleLike a Main() method for a libraryKnown entry point in the moduleInitializes Container typesViewsRegionsServicesControllersEtc 2010 Brian Noyes, IDesign Inc. All rights reserved9

9/16/2010Module Loading Prism supports: Statically from codeDynamically Module catalog XAMLConfig file or directory scan in WPFOn-demandModules can be dependent on other modules Need to resolve load order in that caseModularity Implementations Two implementations in Prism 4: Unity container Managed Extensibility Framework (MEF)Either/or decisionSame implementation patternsDifference is your use of dependency injection coding patterns inthe module code 2010 Brian Noyes, IDesign Inc. All rights reserved10

9/16/2010Regions Placeholder (named location) for view containment Place to plug in views Views dynamically added by app/module codePrism 2 supports two approaches: View Discovery View InjectionCan be defined by the shell or a composite view Shell – almost always Composite View – less oftenRegions 2010 Brian Noyes, IDesign Inc. All rights reserved11

9/16/2010Region Manager Prism serviceRegistration point for named regionsModules get a region references from the region managerUse the region to add their viewsCommand Pattern 2010 Brian Noyes, IDesign Inc. All rights reserved12

9/16/2010Prism Commands Based on WPF/Silverlight ICommand interfaceGets the handling out of the visual tree Handlers can be view models or controllersBreaks the dependency on focus and event routing in the visualtreeAllows multiple targetsComposite CommandsSubmit mmandOrderDetailsSubmitDelegate Commands 2010 Brian Noyes, IDesign Inc. All rights reserved13

9/16/2010Prism Events Address different scenarios than .NET Events or WPF/Silverlight RoutedEventsBased on pub/sub and event aggregator patternsDecouples publishers and subscribers TypeLifetimePrism provides IEventAggregator serviceGet event from aggregatorSubscribe or publishHandles weak referencesHandles threading issuesProvides filtering capabilityAllows communications between loosely coupled, non-visual parts Presenters and controllersEvent rManagerOrderListPresenter 2010 Brian Noyes, IDesign Inc. All rights reserved14

9/16/2010IActiveAware Infrastructure for determining “Active” view Can mean different things based on: Containercontrol State of view Region adapters can set IsActive flag on views within a SelectorregionViews (or ViewModels) can use to set IsActive flag onDelegateCommandCompositeCommand can monitor active status of childcommandsMVVM Guidance Documentation and samples on implementing the MVVM patternBasic QuickStart, full QuickStart, and Reference Implementation sampleExamples of: Static hook up of view and view model from the view Dynamic hook up of view and view model through data templates ViewModel base class to encapsulate common concerns “Wrapping” model properties to add property change and/or validationimplementation Exposing model properties when model supports needed interfaces View model support for view that is not part of the model Behaviors to communicate between view and view model 2010 Brian Noyes, IDesign Inc. All rights reserved15

9/16/2010Navigation Guidance State-based Navigation Based on the Visual State Manager Small scale application or portions of an application Use state transitions to “switch” views from a user perspective Reallyjust state transitions within a single view definition at a codelevelNavigation Guidance Region-based Navigation Use URIs to indicate logical views that you want todisplay/navigate to Navigation service translates those URIs into view switchingwithin a region Journaling of where you have been with forward/back nav Potential for deep linking in Silverlight Integration with Silverlight Navigation framework Allows views to decide whether to allow navigation in astandard way i.e.unsaved work 2010 Brian Noyes, IDesign Inc. All rights reserved16

9/16/2010Unity / MEFPatterns in CALHost ApplicationShellAdapterRegionCompositeViewPrism resentationModelViewModelPlug f ommandRepositoryRepositoryCommands 2010 Brian Noyes, IDesign Inc. All rights reserved17

Prism Version History Prism 1 – June 2008 – WPF Only Prism 2 – Feb 2009 – Added support for Silverlight 3 Prism 2.1 – October 2009 – Minor update Prism 2.2 – July 2010 – Updated for .NET 4 / Silverlight 4 Prism 4 – October 2010 – MVVM / MEF / Navigation added

Related Documents:

Solution a) Volume of a right rectangular prism area of rectangular base height of prism Volume of a right rectangular prism (length width) height V l w h V 2 3 4 V 24 The volume of the right rectangular prism is 24 cm3. b) A cube is also a right rectangular prism. Volume o

10 Performance of Routine Information System Management (PRISM) Toolkit . This new, more comprehensive PRISM Series is useful for designing, strengthening, and evaluating RHIS performance and developing a plan to put the results of a PRISM assessment into action. The revised "PRISM Tools"—the PRISM Series' core document—offers the .

Copy the net for a rectangular prism. Label each side as h, w, or ℓ. Then use your drawing to write a formula for the surface area of a rectangular prism. h w 1 ACTIVITY: Surface Area of a Right Rectangular Prism Lateral Face Base Rectangular Prism Triangular Prism The surface area of a

Aug 20, 2015 · PRISM system, and provides a general system architecture diagram. Section 4: PRISM Data Description – Provides layouts for the files used by the system. Section 5: PRISM Data Processing – Provides details on how to process PRISM data.

9-2 Volume of Prisms and Cylinders Find how many cubes the prism holds. Then give the prism’s volume. You can find the volume of this prism by counting how many cubes tall, long, and wide the prism is and then multiplying. 2 · 4 · 3 24 There are 24 cubes in the prism, so the volume is 24 cubic units.

Teletrac, Inc. - Prism TM Information and Installation Guide 1622-0300 B1 3/18/04 3 KEY PERFORMANCE INDICATORS With no direct supervision and with written guidelines, the Prism TM installer will be able to: Describe the peripheral equipment used in a Prism TM installation Identify the internal components that make up a Prism TM

The PRISM project has been (and the PRISM team now is) a driving force and has put Europe in the loop for long-awaited community-wide convergence on basic standards in ES modelling. 2.2 Overview of the existing PRISM tools and standards The PRISM infrastructure is a collection of software tools designed to help configure, execute and analyse

di erent engineering associations such as the mechanical engineers, the civil engineers, and the electronic engineers. But these definitions have a common core. There’s a fairly common simple definition, which a lot of the more complicated definitions are variations on. On this definition, engineering is the process of utilizing knowledge and principles to design, build, and analyze .