BSA – Data Flow

BSA contains two techniques to model data. One is classic ER Diagrams and the second UML Class Diagrams. Class diagrams provide an object oriented approach that will go well with languages like C++, C# and Java, but a class is basically only a definition of a new datatype that you can declare as a variable using ER Diagrams. Tables in ER Diagrams represent actual, physical data structures with variables. This is how BSA will need to use the two techniques and the current scope focus on ER Diagrams. It might be incorrect of me to use terms like “ER Diagrams” and “UML Class Diagrams” because at the end of the day I tailor the modelling techniques to what I need them to be to support an executable specification.

Each diagram name must be unique and as you draw a table on a diagram the diagram name + table name form an unique, global name that can be accessed from anywhere.

This example show a simple Customer Table, an associated form to edit it’s content and the logic of what happens if you press the OK button. Both Tables, Forms and the components you add have multiple events you can activate with the PLD Start symbol, but I only show one event processed here for the purpose of illustrating BSA at use.

To be formal I should probably call the event “Form_Customer.Button_OK.LeftMouseUP” or something, but I want to look into default naming to simplify diagrams, so if I use the name “OK” on the button and as no other object on the diagram uses that name – “OK” should be ok – local name scope. I need to work a bit on the details here, but I am reaching a point where I can generate code. And once I start generating code I will probably also need to adjust BSA to cover details I have not seen yet.

Another observation is that the forms and logic shown above can be auto-generated from the Table definition – simply adding a Wizard that provide a default diagram you can change afterwards. This capability is worth gold if you do heavy database modeling and want to quickly test your model. Keep in mind that the “Table” here can be anything from a real SQL Table, to a XML file, RAM table etc.

The one thing I am a little unsure about is binding of events from the Table to the Form – I think I will like to avoid creating a “source” in the edit fields and force “Fetch” to convert data in the current entry to fields on the screen (or other data entries) – this way I leave the user full manual control and avoid auto-magic that don’t always work. The complete diagram can be see below.

I think this will work out just fine – and sorry for the dotted flow lines – that is a bug 🙁

One complicating factor here is that Select, fetch and Update hide the executable details – you will have to click on each bog to see actual code in form of properties. This means that while it is easy to follow logic it is more difficult to see actual code and find bugs – so I need to work on that a bit as I address the debugger later.

BSA is coming together, but it is a complex tool and lot of things that needs to work properly. I am currently focusing on classic database modelling, Forms and Modbus in the first release that probably only will target C#. It is more or less exactly 1 year since I started on this task with WPF so progress have been good, but it is still a lot of work to be done.

Categories: BSA

Leave a Reply