SlideShare a Scribd company logo
1 of 45
Download to read offline
by @nsdevaraj
What we'll discuss
       DI/ IoC Introduction
       View Patterns
       What, Why, How
         What is Swiz?
         Why should you use it?
       Advanced Swiz
       Swiz DAO
What the Hell is IoC?
     Inversion of Control, is... design in which the
     flow of control of a system is inverted...
     -Wikipedia




       Separate configuration from
       execution
       Promotes encapsulation
       Promotes simpler, focused
       components
What the Hell is IoC?
  Reusing your code in efficient way.
  Consider CRUD Operations Logic
  or any logic being written once and
  used across your application.
  Coding Logic not being repeated
  will help you in efficient testing.
  Dependency Injection helps you
  [Inject] Objects and get use of
  deferred instantiation.
  Context helps you have a hold on
  whole application.
IoC / Dependency Injection


  The Inversion of Control (IoC) and
  Dependency Injection (DI) patterns are all
  about removing dependencies from your
  code.
  IoC/DI are not technologies, they are
  methods.
  The Hollywood principle "Don't call us, we'll
  call you".
IoC / Dependency Injection

For example:
public class TextEditor
{
  private SpellChecker checker;
  public function TextEditor()
  {
     checker = new SpellChecker();
  }
}


What we've done here is create a dependency
between the TextEditor and the SpellChecker.
IoC / Dependency Injection
In an IoC scenario we would instead do
something like this:
public class TextEditor
{
  private ISpellChecker checker;
  public function TextEditor(ISpellChecker checker)
  {
     this.checker = checker;
  }
}
Now, while creating the TextEditor class you
have the control over which SpellChecker
implementation to use. We're injecting the
TextEditor with the dependency.
View Patterns Hierarchy
MVP Patterns
Passive View                      Supervising Controller




  Both variants allow you to increase the testability of your
  presentation logic.
MVP Patterns

Passive View
MVP Patterns

Supervising Controller
Presentation Model
Why not Traditional MVC?


  You want to maximize the code that can be
  tested with automation. (Views are hard to
  test.)
  You want to share code between pages that
  require the same behavior.
  You want to separate business logic from UI
  logic to make the code easier to understand
  and maintain.
Comparison




         L - UI logic
         S - State of the UI
Why Passive View?

  Presentation Model and Supervising
  Controller are both reasonable alternatives.
  The strength that Passive View is that both
  of the alternatives require the view to do
  some of the synchronization work, which
  results in more untestable behavior.
  In Passive View, all the view update logic is
  placed in the presenter.
How to create Passive View?
 Separate the responsibilities for the visual
 display and the event handling behavior into
 different classes named, respectively,
 the view and the presenter.
 The view class manages the controls on the
 page.
 The presenter contains the logic to respond
 to the events, update the model (business
 logic and data of the application) and, in turn,
 manipulate the state of the view.
Swiz Framework
What Swiz Users are saying..

  “Broadchoice evaluated a few
  frameworks and settled on Swiz as the
  keystone behind our Workspace
  product.”
    Sean Corfield, CTO Railo US
What Swiz Users are saying..

  “Personally I think it is way better then
  Cairngorm!”
    Kurt Wiersma, some Mach-ii dude
Why Swiz?

  Because those guys told you to?
  Not at all!! But Swiz is...
  Simple and effective!
  Easy to learn!
  Designed to help you write less code!
  Encourages loose coupling through
  MVC!
Let's Start..




        What is Swiz all about?
Swiz Overview

  Flex Applications Require:
    Remote Services
    Models / Data
    Controllers / Logic
    Views
Swiz Overview

  Components need
  each other
    Wire ourselves
    Use Locators
    Verbose XML
Swiz Overview

  Components need
  each other
    Wire ourselves
    Use Locators
    Verbose XML
    IoC
    Annotations
Swiz Overview

  Views communicate
  with components
    Flex Events
    MVC Paradigm
    DynamicMediator
    makes it easy!
Swiz Overview
 Applications need remote data
   Async Tokens
   Responders
   State around calls
   SwizResponder
   makes it easy!
Swiz Features

  IoC
    injects app
  DynamicResponder
    remote data
  DynamicMediator
    event handling
  and a whole lot more...
Swiz Doesn't mess with..

  Excessive JEE patterns
  Boilerplate code
  Verbose XML / MXML configuration
  Overly Prescriptive workflow
IoC Recap..

  Components require ‘dependencies’
  to function
  Dependencies may be simple strings and
  values, or other components
  Resolving complex dependencies is
  outside the scope of primary logic
IoC with Swiz

  Express dependencies through
  Metadata, or ‘Annotations’
  Swiz takes care of configuration through
  Dependency Injection
  Views also have dependencies such as
  Models, or PresentationModels
  Swiz handles everything for you!!
Advanced Swiz




         Working with Swiz
Defining Beans

  Define components in BeanLoaders
  Written in plain old MXML
  Swiz calls objects Beans because it only
  cares about their properties
Defining BeanLoaders
<BeanLoader xmlns=“org.swizframework.util.*”
xmlns:mx=http://www.adobe.com/2006/mxml>

<mx:RemoteObject id=“userService”
destination=“userService”/>
<mx:RemoteObject id=“mapService”
destination=“mapService”/>
<controller:UserController id=“userController”/>
<controller:MapController id=“mapController”/>
</BeanLoader>
Swiz's IoC Factory

  When Swiz loads beans, it searches for
  ‘Inject’ metadata
  When objects are retrieved, Swiz
  performs the magic of Injecting
  Swiz adds event listeners for added to
  stage and removed from stage events
  Allows Swiz to Inject and clean up Views
  too!
Loading Swiz

  Use Swiz’s ConfigBean in MXML
  Requires an array of BeanLoaders
  Access to all configuration parameters

  <swizframework:SwizConfig strict="true"
  beanLoaders="{[Beans]}"
  logEventLevel="{LogEventLevel.WARN}"/>
Expressing Dependencies

  Dependencies are NOT defined in
  MXML!
  Use [Inject] in your AS objects
  Similar to new Spring 2.0 configuration
  Qualify bean to inject by id.
  [Inject(bean="userController")]
  public var userController: UserController;
Expressing Dependencies

  To inject by type, forget the ‘bean’
  Swiz looks for bean which matches the
  variable type
  Works with interfaces and inheritance
  Swiz throws ‘AmbiguousBean’ error if
  more than one bean could be injected
View Autowiring

  You can use Inject on accessors as well
  as properties
  Properties can be autowired with two
  way bindings!
  Accessors allow views to perform logic
  when dependencies are set
Working with RemoteObjects

  ServiceHelper bind result and fault
  handlers transparently
  Swiz offers simple methods for creating
  in AbstractController
Dynamic Mediators
   Add [Mediate] annotation to a Controller
   function
[Mediate(event=“eventType”, properties=“foo, bar”)]
public function doStuff(argA : String, argB : String) {}
   Swiz creates a DynamicMediator for you
   Adds an eventListener for supplied type to
   Swiz’s centralDispatcher
   Uses ‘properties’ to construct method call
Recap

  Swiz’s IoC is very easy to use
  Swiz provides a simple MVC paradigm
  Very little XML! Mostly Annotations
  Swiz provides core utilities for:
    SwizResponders and ChainEvents
    Event handling
    DynamicMediators
Recap

  Swiz represents best practices learned
  from years of consulting
  Swiz is damn easy!
  New features are coming fast and
  furious!
Swiz 1.0
  Module support
  Any AS3 Project Support
  AIR windows support
  Additional metadata:
  [PostConstruct], [PreDestroy]
  Custom metadata processors (might be
  THE killer feature of Swiz)
Let's Start Coding...
Resources
Swiz Resources
   http://github.com/swiz/swiz-framework/
   http://groups.google.com/group/swiz-framework
   http://cdscott.blogspot.com
   http://soenkerohde.com
   http://www.returnundefined.com
Other Resources
   http://github.com/nsdevaraj/SwizDAO
   http://code.google.com/p/dphibernate
   http://code.google.com/p/flex-mojos
   http://code.google.com/p/loom

More Related Content

What's hot

Security on Rails
Security on RailsSecurity on Rails
Security on RailsDavid Paluy
 
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Matt Raible
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDotNetCampus
 
SYDSP - Office 365 and Cloud Identity - What does it mean for me?
SYDSP  - Office 365 and Cloud Identity - What does it mean for me?SYDSP  - Office 365 and Cloud Identity - What does it mean for me?
SYDSP - Office 365 and Cloud Identity - What does it mean for me?Scott Hoag
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsJoonas Westlin
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsLilia Sfaxi
 
Dependency injection Drupal Camp Wrocław 2014
Dependency injection Drupal Camp Wrocław 2014Dependency injection Drupal Camp Wrocław 2014
Dependency injection Drupal Camp Wrocław 2014Greg Szczotka
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Christian Schneider
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentRoy Kim
 
JavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopJavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopPeter Lehto
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with KeycloakJulien Pivotto
 
Azure Active Directory - An Introduction for Developers
Azure Active Directory - An Introduction for DevelopersAzure Active Directory - An Introduction for Developers
Azure Active Directory - An Introduction for DevelopersJohn Garland
 
Asec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedAsec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedDinis Cruz
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for DevelopersSarah Dutkiewicz
 
Node.js and the new front-end
Node.js and the new front-endNode.js and the new front-end
Node.js and the new front-endEqual Experts
 
Rhinos have tea_on_azure
Rhinos have tea_on_azureRhinos have tea_on_azure
Rhinos have tea_on_azureCEDRIC DERUE
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoMoldova ICT Summit
 

What's hot (20)

Security on Rails
Security on RailsSecurity on Rails
Security on Rails
 
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...Security Patterns for Microservice Architectures - ADTMag Microservices & API...
Security Patterns for Microservice Architectures - ADTMag Microservices & API...
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforusso
 
SYDSP - Office 365 and Cloud Identity - What does it mean for me?
SYDSP  - Office 365 and Cloud Identity - What does it mean for me?SYDSP  - Office 365 and Cloud Identity - What does it mean for me?
SYDSP - Office 365 and Cloud Identity - What does it mean for me?
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Dependency injection Drupal Camp Wrocław 2014
Dependency injection Drupal Camp Wrocław 2014Dependency injection Drupal Camp Wrocław 2014
Dependency injection Drupal Camp Wrocław 2014
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
 
JavaEE with Vaadin - Workshop
JavaEE with Vaadin - WorkshopJavaEE with Vaadin - Workshop
JavaEE with Vaadin - Workshop
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
Azure Active Directory - An Introduction for Developers
Azure Active Directory - An Introduction for DevelopersAzure Active Directory - An Introduction for Developers
Azure Active Directory - An Introduction for Developers
 
React Vs AnagularJS
React Vs AnagularJSReact Vs AnagularJS
React Vs AnagularJS
 
Asec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwnedAsec r01-resting-on-your-laurels-will-get-you-pwned
Asec r01-resting-on-your-laurels-will-get-you-pwned
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for Developers
 
Node.js and the new front-end
Node.js and the new front-endNode.js and the new front-end
Node.js and the new front-end
 
Apache Wicket
Apache WicketApache Wicket
Apache Wicket
 
FREE Sql Server syllabus
FREE Sql Server syllabusFREE Sql Server syllabus
FREE Sql Server syllabus
 
Rhinos have tea_on_azure
Rhinos have tea_on_azureRhinos have tea_on_azure
Rhinos have tea_on_azure
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
 

Viewers also liked

Digging into Diigo
Digging into DiigoDigging into Diigo
Digging into DiigoKaren VItek
 
Best Apps and Websites for Classroom Management
Best Apps and Websites for Classroom ManagementBest Apps and Websites for Classroom Management
Best Apps and Websites for Classroom ManagementKaren VItek
 
NYSCATE HV 2015 ScratchJr Hour of Code
NYSCATE HV 2015 ScratchJr Hour of CodeNYSCATE HV 2015 ScratchJr Hour of Code
NYSCATE HV 2015 ScratchJr Hour of CodeKaren VItek
 
Swift Growth Slides
Swift Growth SlidesSwift Growth Slides
Swift Growth Slidesguestee0ab0
 
Ai Investor Presentation July 2007
Ai Investor Presentation July 2007Ai Investor Presentation July 2007
Ai Investor Presentation July 2007Teguh Prasetya
 
Free iPad Apps for Foreign Language, Productivity & Teachers
Free iPad Apps for Foreign Language, Productivity & TeachersFree iPad Apps for Foreign Language, Productivity & Teachers
Free iPad Apps for Foreign Language, Productivity & TeachersKaren VItek
 

Viewers also liked (7)

Digging into Diigo
Digging into DiigoDigging into Diigo
Digging into Diigo
 
BlazeDS
BlazeDSBlazeDS
BlazeDS
 
Best Apps and Websites for Classroom Management
Best Apps and Websites for Classroom ManagementBest Apps and Websites for Classroom Management
Best Apps and Websites for Classroom Management
 
NYSCATE HV 2015 ScratchJr Hour of Code
NYSCATE HV 2015 ScratchJr Hour of CodeNYSCATE HV 2015 ScratchJr Hour of Code
NYSCATE HV 2015 ScratchJr Hour of Code
 
Swift Growth Slides
Swift Growth SlidesSwift Growth Slides
Swift Growth Slides
 
Ai Investor Presentation July 2007
Ai Investor Presentation July 2007Ai Investor Presentation July 2007
Ai Investor Presentation July 2007
 
Free iPad Apps for Foreign Language, Productivity & Teachers
Free iPad Apps for Foreign Language, Productivity & TeachersFree iPad Apps for Foreign Language, Productivity & Teachers
Free iPad Apps for Foreign Language, Productivity & Teachers
 

Similar to Swiz DAO

Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkASG
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion PrincipleShahriar Hyder
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Svetlin Nakov
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptxNourhanTarek23
 
Oleksandr Valetskyy - Become a .NET dependency injection ninja with Ninject
Oleksandr Valetskyy - Become a .NET dependency injection ninja with NinjectOleksandr Valetskyy - Become a .NET dependency injection ninja with Ninject
Oleksandr Valetskyy - Become a .NET dependency injection ninja with NinjectOleksandr Valetskyy
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009Jonas Follesø
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better softwarematthoneycutt
 
Summer internship report
Summer internship reportSummer internship report
Summer internship reportIpsit Pradhan
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
Riacon swiz
Riacon swizRiacon swiz
Riacon swizntunney
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET WebskillsCaleb Jenkins
 
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, MadridOpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, MadridDierk König
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applicationspeychevi
 
VIPER Architecture
VIPER ArchitectureVIPER Architecture
VIPER ArchitectureAhmed Lotfy
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiJared Faris
 
Dip(dependency inversion principle) presentation
Dip(dependency inversion principle) presentationDip(dependency inversion principle) presentation
Dip(dependency inversion principle) presentationqamar mustafa
 

Similar to Swiz DAO (20)

Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Introduction to Spring sec1.pptx
Introduction to Spring sec1.pptxIntroduction to Spring sec1.pptx
Introduction to Spring sec1.pptx
 
Oleksandr Valetskyy - Become a .NET dependency injection ninja with Ninject
Oleksandr Valetskyy - Become a .NET dependency injection ninja with NinjectOleksandr Valetskyy - Become a .NET dependency injection ninja with Ninject
Oleksandr Valetskyy - Become a .NET dependency injection ninja with Ninject
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better software
 
Summer internship report
Summer internship reportSummer internship report
Summer internship report
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Riacon swiz
Riacon swizRiacon swiz
Riacon swiz
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, MadridOpenDolphin with GroovyFX Workshop at GreachConf, Madrid
OpenDolphin with GroovyFX Workshop at GreachConf, Madrid
 
Monorail Introduction
Monorail IntroductionMonorail Introduction
Monorail Introduction
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applications
 
VIPER
VIPERVIPER
VIPER
 
VIPER Architecture
VIPER ArchitectureVIPER Architecture
VIPER Architecture
 
Building Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript SpaghettiBuilding Rich User Experiences Without JavaScript Spaghetti
Building Rich User Experiences Without JavaScript Spaghetti
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Dip(dependency inversion principle) presentation
Dip(dependency inversion principle) presentationDip(dependency inversion principle) presentation
Dip(dependency inversion principle) presentation
 

Recently uploaded

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Swiz DAO

  • 2. What we'll discuss DI/ IoC Introduction View Patterns What, Why, How What is Swiz? Why should you use it? Advanced Swiz Swiz DAO
  • 3. What the Hell is IoC? Inversion of Control, is... design in which the flow of control of a system is inverted... -Wikipedia Separate configuration from execution Promotes encapsulation Promotes simpler, focused components
  • 4. What the Hell is IoC? Reusing your code in efficient way. Consider CRUD Operations Logic or any logic being written once and used across your application. Coding Logic not being repeated will help you in efficient testing. Dependency Injection helps you [Inject] Objects and get use of deferred instantiation. Context helps you have a hold on whole application.
  • 5. IoC / Dependency Injection The Inversion of Control (IoC) and Dependency Injection (DI) patterns are all about removing dependencies from your code. IoC/DI are not technologies, they are methods. The Hollywood principle "Don't call us, we'll call you".
  • 6. IoC / Dependency Injection For example: public class TextEditor { private SpellChecker checker; public function TextEditor() { checker = new SpellChecker(); } } What we've done here is create a dependency between the TextEditor and the SpellChecker.
  • 7. IoC / Dependency Injection In an IoC scenario we would instead do something like this: public class TextEditor { private ISpellChecker checker; public function TextEditor(ISpellChecker checker) { this.checker = checker; } } Now, while creating the TextEditor class you have the control over which SpellChecker implementation to use. We're injecting the TextEditor with the dependency.
  • 9. MVP Patterns Passive View Supervising Controller Both variants allow you to increase the testability of your presentation logic.
  • 13. Why not Traditional MVC? You want to maximize the code that can be tested with automation. (Views are hard to test.) You want to share code between pages that require the same behavior. You want to separate business logic from UI logic to make the code easier to understand and maintain.
  • 14. Comparison L - UI logic S - State of the UI
  • 15. Why Passive View? Presentation Model and Supervising Controller are both reasonable alternatives. The strength that Passive View is that both of the alternatives require the view to do some of the synchronization work, which results in more untestable behavior. In Passive View, all the view update logic is placed in the presenter.
  • 16. How to create Passive View? Separate the responsibilities for the visual display and the event handling behavior into different classes named, respectively, the view and the presenter. The view class manages the controls on the page. The presenter contains the logic to respond to the events, update the model (business logic and data of the application) and, in turn, manipulate the state of the view.
  • 18. What Swiz Users are saying.. “Broadchoice evaluated a few frameworks and settled on Swiz as the keystone behind our Workspace product.” Sean Corfield, CTO Railo US
  • 19. What Swiz Users are saying.. “Personally I think it is way better then Cairngorm!” Kurt Wiersma, some Mach-ii dude
  • 20. Why Swiz? Because those guys told you to? Not at all!! But Swiz is... Simple and effective! Easy to learn! Designed to help you write less code! Encourages loose coupling through MVC!
  • 21. Let's Start.. What is Swiz all about?
  • 22. Swiz Overview Flex Applications Require: Remote Services Models / Data Controllers / Logic Views
  • 23. Swiz Overview Components need each other Wire ourselves Use Locators Verbose XML
  • 24. Swiz Overview Components need each other Wire ourselves Use Locators Verbose XML IoC Annotations
  • 25. Swiz Overview Views communicate with components Flex Events MVC Paradigm DynamicMediator makes it easy!
  • 26. Swiz Overview Applications need remote data Async Tokens Responders State around calls SwizResponder makes it easy!
  • 27. Swiz Features IoC injects app DynamicResponder remote data DynamicMediator event handling and a whole lot more...
  • 28. Swiz Doesn't mess with.. Excessive JEE patterns Boilerplate code Verbose XML / MXML configuration Overly Prescriptive workflow
  • 29. IoC Recap.. Components require ‘dependencies’ to function Dependencies may be simple strings and values, or other components Resolving complex dependencies is outside the scope of primary logic
  • 30. IoC with Swiz Express dependencies through Metadata, or ‘Annotations’ Swiz takes care of configuration through Dependency Injection Views also have dependencies such as Models, or PresentationModels Swiz handles everything for you!!
  • 31. Advanced Swiz Working with Swiz
  • 32. Defining Beans Define components in BeanLoaders Written in plain old MXML Swiz calls objects Beans because it only cares about their properties
  • 33. Defining BeanLoaders <BeanLoader xmlns=“org.swizframework.util.*” xmlns:mx=http://www.adobe.com/2006/mxml> <mx:RemoteObject id=“userService” destination=“userService”/> <mx:RemoteObject id=“mapService” destination=“mapService”/> <controller:UserController id=“userController”/> <controller:MapController id=“mapController”/> </BeanLoader>
  • 34. Swiz's IoC Factory When Swiz loads beans, it searches for ‘Inject’ metadata When objects are retrieved, Swiz performs the magic of Injecting Swiz adds event listeners for added to stage and removed from stage events Allows Swiz to Inject and clean up Views too!
  • 35. Loading Swiz Use Swiz’s ConfigBean in MXML Requires an array of BeanLoaders Access to all configuration parameters <swizframework:SwizConfig strict="true" beanLoaders="{[Beans]}" logEventLevel="{LogEventLevel.WARN}"/>
  • 36. Expressing Dependencies Dependencies are NOT defined in MXML! Use [Inject] in your AS objects Similar to new Spring 2.0 configuration Qualify bean to inject by id. [Inject(bean="userController")] public var userController: UserController;
  • 37. Expressing Dependencies To inject by type, forget the ‘bean’ Swiz looks for bean which matches the variable type Works with interfaces and inheritance Swiz throws ‘AmbiguousBean’ error if more than one bean could be injected
  • 38. View Autowiring You can use Inject on accessors as well as properties Properties can be autowired with two way bindings! Accessors allow views to perform logic when dependencies are set
  • 39. Working with RemoteObjects ServiceHelper bind result and fault handlers transparently Swiz offers simple methods for creating in AbstractController
  • 40. Dynamic Mediators Add [Mediate] annotation to a Controller function [Mediate(event=“eventType”, properties=“foo, bar”)] public function doStuff(argA : String, argB : String) {} Swiz creates a DynamicMediator for you Adds an eventListener for supplied type to Swiz’s centralDispatcher Uses ‘properties’ to construct method call
  • 41. Recap Swiz’s IoC is very easy to use Swiz provides a simple MVC paradigm Very little XML! Mostly Annotations Swiz provides core utilities for: SwizResponders and ChainEvents Event handling DynamicMediators
  • 42. Recap Swiz represents best practices learned from years of consulting Swiz is damn easy! New features are coming fast and furious!
  • 43. Swiz 1.0 Module support Any AS3 Project Support AIR windows support Additional metadata: [PostConstruct], [PreDestroy] Custom metadata processors (might be THE killer feature of Swiz)
  • 45. Resources Swiz Resources http://github.com/swiz/swiz-framework/ http://groups.google.com/group/swiz-framework http://cdscott.blogspot.com http://soenkerohde.com http://www.returnundefined.com Other Resources http://github.com/nsdevaraj/SwizDAO http://code.google.com/p/dphibernate http://code.google.com/p/flex-mojos http://code.google.com/p/loom