Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "NIANIO Pattern Błażej Chodarcewicz Warsaw, 2006-02-22."— 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 Java implementation of Nianio State - schema structure Command - schema variant External command - schema variant State = { … } Cmd = variant [java mm] { … } ExtCmd = variant [java mm] {…} Nianio = public State invoke(State, Cmd, ExtCmd.MM) Function No side efects ExtCmd.MM accumulates commands

7 AppState = { reportFile, xmlFile, xsdFile, outputFile : SelectFileState = { fileName : string ? fileChooserState : FileChooserParams= { kind : FileChooserKind = variant {open | save} extensions : array of string description : string } outputKind : OutputKind = variant {html | pdf | xls} status : Status = variant { generatingReport of int | ready } messageDialogStates : MsgDialogs } MsgDialogs = [java dict [key]] array of 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?


Download ppt "NIANIO Pattern Błażej Chodarcewicz Warsaw, 2006-02-22."

Similar presentations


Ads by Google