Your SlideShare is downloading. ×
  • Like
Prism
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Prism

  • 666 views
Published

Realizarea de aplicatii composite folosind Microsoft patterns & practices Prism

Realizarea de aplicatii composite folosind Microsoft patterns & practices Prism

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
666
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Microsoft patterns & practicesPRISM
    Realizarea de aplicatii composite folosind
    Sebastian Negomireanu
  • 2. Ceeste Prism?
    Un set de regulisipractici
    Colectie de design patterns
    O implementare “referinta”, cepoate fi usormodificata
    Un set de exemple “hands-on”
  • 3. Aplicatiipretabile la PRISM
    • Aplicatiimodulare Silverlight si/sau WPF
  • Aplicatiipretabile la PRISM
    • Aplicatiimodulare Silverlight si/sau WPF
    • 4. Cu maimulte “ecrane”
  • Aplicatiipretabile la PRISM
    • Aplicatiimodulare Silverlight si/sau WPF
    • 5. Cu maimulte “ecrane”
    • 6. Interactiunecomplexa (sibogata) cu utilizatorul
  • Aplicatiipretabile la PRISM
    • Aplicatiimodulare Silverlight si/sau WPF
    • 7. Cu maimulte “ecrane”
    • 8. Interactiunecomplexa (sibogata) cu utilizatorul
    • 9. Vizualizari multiple de date
  • Aplicatiipretabile la PRISM
    • Aplicatiimodulare Silverlight si/sau WPF
    • 10. Cu maimulte “ecrane”
    • 11. Interactiunecomplexa (sibogata) cu utilizatorul
    • 12. Vizualizari multiple de date
    • 13. Aplicatii cu un timp de viata lung (ani), care trebuiesa se adapteze la modificarineprevazute
  • Arhitecturaaplicatiilor PRISM
  • 14. Mai clar…
  • 15. Bootstrapper
    Clasaresponsabila cu initializarea PRISM:
    Seteaza Shell-ulcaRootVisual
    Inregistreaza in containerul DI toateserviciile/elementelecomuneintregiiaplicatii
    Incarcamodulelesauspecifcastrategia de incarcare
    Specificaalteinformatiinecesarerulariiaplicatiei (logging, framework exceptions, region adapters etc.)
  • 16. Dependency Injection
    Design pattern care ajuta la:
    Reducereadependintelordintreobiecteindependente
    Ajuta la gestiunea lifetime-uluiobiectelorintr-un mod centralizat (per-instance, singleton etc.)
    IoC/DI
    Consumer
    Resolve
    Register
    ServiceA
    Constructor(IService service)
    IService
    ServiceB
  • 17. Dependency Injection
  • 18. Shell
    Reprezinta “baza” aplicatiei
    In mod normal continedoarregiuni
    Functioneazaca un container pentru UI
    Regiunilesuntcontinute in containere:
    ItemsControl
    TabControl
    Noicontainere pot fi adaugateprinimplementarea de adaptere (ex. GridView)
  • 19. Modularitate
  • 20. Procesul de incarcarea modulelor
    Module catalog
  • 21. Partitionare in module
  • 22. Partitionarepeverticala
  • 23. Partitionarepeorizontala
  • 24. Comunicareintre module
    ModulA
    Publish
    Event Aggregator
    Subscribe
    ModulB
    ModulC
    ModulD
  • 25. Comunicareintre module
    ModulA
    Event
    Event Aggregator
    Event
    Event
    Event
    ModulB
    ModulD
    ModulC
  • 26. MVVM
    Model
    View
    ViewModel
    Services
    INotifyCollectionChanged
    INotifyPropertyChanged
    Interaction
    View
    ViewModel
    Model
    Notifications
    Data binding
    Commands
    Business
    Logic
    Presentation
    Logic
    UI
    (XAML)
    UI Logic
    (code behind)
  • 27. View
    Element vizual (Window, Page, control, data template etc.)
    NU are nici un fel de business logic implementat
    In general reactiv (prin data binding)
    AcceseazaViewModelprinintermediulDataContext
    Poateavealogica, darlimitata la UI (ex. declansareanimatii, behaviors etc.)
    Intotdeaunaruleazapethreadul UI-ului
  • 28. ViewModel
    E o clasa non-vizuala
    Incapsuleazalogica de prezentaresidatelepentru view
    Expuneproprietatipentru data binding (intotdeaunapetheadul UI-ului)
    Extindemodelul cu proprietatisimetodespecificelayerului de prezentare
    Nu are referinta la View si nu are informatiidespreimplementareaspecifica a View-ului
    Poate fi folosit in comun de view-uridiferite
    De obiceiimplementeazaINotifyPropertyChangedsi/sauINotifyCollection Changed pentru a suporta data-binding
    PoateimplementaIDataErrorInfo/INotifyDataErrorInfopentruvalidare
  • 29. Model
    Clase non-vizuale care incapsuleaza business-logic-ul
    Nu au referinta la View sauViewModelsi nu depind de detaliile de implementare
    De obiceiimplementeazaINotifyPropertyChangedsi/sauINotifyCollection Changed pentru a suportadata-binding siIDataErrorInfo/INotifyDataErrorInfopentruvalidare
    De obicei se folosescimpreuna cu un serviciusau repository pentrupersistenta, acces la date si caching
  • 30. Procesul de creare al aplicatiilor
    Creareproiect Shell
    Definireregiuni Shell
    Creare M/V/VM
    Creare M/V/VM
    Crearemodulaplicatie
    Crearemodulaplicatie
    CreareServicii
    CreareServicii
    CreareBootstrapper
    Crearemodulinfrastructura
    Definirecomenzi
    comune
    Definireevenimentecomune
    Definirealtetipuri / helperecomune
  • 31. Definirea Shell-ului
    View top-level
    Container marcatcaregiune
    (cu nume)
    Elementevizualeglobale
    (meniuri, toolbar-uri etc.)
    View-urile pot fi compuse din alte view-uri
    View-urile pot continealteregiuni
  • 32. CreareaBootstrapper-ului
    InstantiazaBootstrapper-ul
    Initializari, afiseaza Shell-ul, creeazacatalogul de module siincarcamodulele
    Servicii composite UI (Region Manager, Event Aggregator) siservicii de incarcare a modulelor
    Fereastra top-level (root visual)
  • 33. Creareamodulelor
    Pentruaplicatii desktop:
    • ClassLibrary
    Pentru SL:
    • ClassLibrary (nu permite download on demand)
    • 34. Application (permite download on demand
    Pas optional, pot existacataloage cu functie de discovery
  • 35. Concluzie
    PRISM defineste un set de practicisi patterns care ajuta la dezvoltareaaplicatiilor composite
    Aplicatiile se bazeazape un element central + module (plugins)
    Modulele pot fi incarcate on demand sauimperativ
    Modulelelucreaza independent
    Existamecanismedecuplate care asigura
    Integrareaelementelor de UI ale modulelor (Region Manager)
    Comunicareaintre module (Event Aggregator)
    Declansarea de actiuniintr-un mod generic (Commanding)
    Notificariindependente de UI (Interaction)
    Inregistrare/descoperiretipuri (IoC/DI)
    Separareintre UI (Views), prezentare (ViewModels), logica/domain objects (Models), procese business (Services)
  • 36. Detalii
    Prism website
    http://compositewpf.codeplex.com/
    Contact
    http://byteflux.me/
    http://twitter.com/nseba
    contact@byteflux.me