BorPred–Things are what you make them–so why not try easy

Almost all systems has the need to export and import data. Since it is always very easy to hack something up that does the job – the solution is often to hack something up that does the job – and thus increase the entropy of your system. Not good in the long run.

The BoringPredictableServer has a declarative way to explain what you export and import at the modeling level so that you always are fully documented and never lose grip of what you have.

This solution – as so many others we have in borpred – make use of the ViewModels. Since the ViewModel constitutes a declarative way to transform your model it is very well suited for the job to explain the transformations from your model to a export file, and from an import file to your model.

Excel

Excel is a well known and easy to work with – so we assume your files will be in or transformable to Excel.

An Example

image

 

image

Defining a model to hold some data and a ViewModel that use some of that data.

I also define a small UI-ViewModel so that we enter some test data:

image

I tell BorPred to execute this model in slot A0:

image

 

I start WECPOF to enter some data:

image

I Visit the BorPredServer:

image

I export allinstances of the specific class in the specific format defined by the viewmodel:

image

I get the result as an open document spreadsheet:

image

I change the data a little:

image

I save this as Text – tab-separated , an then go back to borpredserver:

image

 

I point out the ViewModel to use when importing and also the file to use:

image

I then hit Refresh in the WECPOF app to view the imported data:

image

If I would like to update existing objects instead of creating new ones I need to supply the attribute we will use as key and make sure that this is the first column in the import file. Like this:

image

 

image

image

The excel import and export can be accessed as webservices thru the borpredserver:

image

Summary

So this was another little boring and predictable function that we added to BorPred.  You should switch your EcoPersistenceServer to BorPred now – you might not jump with joy because of the switch but you remove a lot of boring and predictable tasks that you would otherwise need to spend time on.

This entry was posted in Declarative, MDrivenServer, ViewModel, WECPOF. Bookmark the permalink.

One Response to BorPred–Things are what you make them–so why not try easy

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.