1 / 13

NIANIO Pattern

NIANIO Pattern. Błażej Chodarcewicz Warsaw, 2006-02-22. Presentation Plan. Current UI problems The Nianio introduction Test application Java patterns Genrap UI future. Current prblems. Incomplete application state A lot of state full objects Synchronization and threads

dlouise
Download Presentation

NIANIO Pattern

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NIANIO Pattern Błażej Chodarcewicz Warsaw, 2006-02-22

  2. Presentation Plan • Current UI problems • The Nianio introduction • Test application • Java patterns • Genrap UI future

  3. Current prblems • Incomplete application state • A lot of state full objects • Synchronization and threads • Models, MM, listeners – loops • Un clear event flow

  4. The NIANIO • State type definition • Command type definition • External command type definition • Function – nianio implementation – logic

  5. Test application – Nianio in practice

  6. State - schema structure Command - schema variant External command - schema variant State = { … } Cmd = variant [java mm] { … } ExtCmd = variant [java mm] {…} Java implementation of Nianio • Nianio = public State invoke(State, Cmd, ExtCmd.MM) • Function • No sideefects • ExtCmd.MM accumulates commands

  7. AppState = { reportFile, xmlFile, xsdFile, outputFile: SelectFileState = { fileName : string ? fileChooserState : FileChooserParams= { kind : FileChooserKind = variant{open | save} extensions :arrayof string description : string } } outputKind : OutputKind= variant{html | pdf | xls} status : Status = variant{generatingReport of int | ready} messageDialogStates : MsgDialogs } MsgDialogs = [java dict [key]] arrayof Entry = { key : MsgDialogKey = string value : MessageDialogParams= { dialogKind : MessageDialogKind = variant{ info |warning | error} message : string } }

  8. AppLogicCmd = [java mm]variant{ run|close |setPdfOutput|setHtmlOutput|setXlsOutput |generateRequest |reportGenerated of GenrapPluginEvent |reportFileCmd of SelectFileCmd |xmlFileCmd of SelectFileCmd |xsdFileCmd of SelectFileCmd |outputFileCmd of SelectFileCmd |messageDialogClosed of MsgDialogKey } SelectFileCmd = [java mm]variant{ setFileName of string |selectFromFileChooser |fileSelected of FileChooserResult = { ? path : string } } GenrapPluginEvent = [java mm]variant{ success of ReportParams |failure of ReportGenerationFailure = { params : ReportParams cause : string } }

  9. AppLogicExtCmd = [java mm]variant{ generate of ReportParams |showMainFrame of MainFrame = { reportFileName, xmlFileName, xsdFileName, outputFileName : string outputKind : OutputKind status : string } |setOutput of OutputKind |setStatus of string |reportFile of SelectFileExtCmd |xmlFile of SelectFileExtCmd |xsdFile of SelectFileExtCmd |outputFile of SelectFileExtCmd |showMessage of ShowMessageCmd = { key : MsgDialogKey params : MessageDialogParams } |closeMainFrame|exit } SelectFileExtCmd = [java mm]variant{ openFileChooser of FileChooserParams |setFileName of string }

  10. More Nianio examples – Test Application Source • Nianio implementation • Nianio invocation • Nianio parameterization • Connecting nianios

  11. Genrap UI future • Nianio and functional code everywhere (no models, listeners) • Small part of code which touch threads, synchronization etc. • Controlled event flow • Clear core structure

  12. Genrap core architecture

  13. Thank you Questions?

More Related