Spacelists

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
lendart1975
Posts: 1
Joined: Wed Nov 22, 2017 10:11 pm

Spacelists

Post by lendart1975 »

Hello.

I wondered if anyone could provide me with an idea of the pro's and con's of using spacelists in VL compared to a data object?

Many thanks
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Spacelists

Post by MarkDale »

There are some comments in the documentation, under Create_Space

http://docs.lansa.com/14/en/lansa015/co ... _space.htm

The advantage of using a SPACE is that they are very very fast, if you need to repeatedly access data and update it, in memory.

The disadvantage is that it does not work on the web client, (or in RDML on the IBMi). (I have not tried it in a server module).
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Spacelists

Post by Stewart Marshall »

It really depends on what you're think of using them for.

If you're manipulating large volumes of data in something akin to a typical batch process, space lists are very handy because they're quick. They are however nothing more than set of dumb variables.

If you're building a complex UI made up of many parts, with lots of user interaction, using data objects is without doubt best practice. Data objects remove much of the complexity of the UI code by wrapping up the rules and behaviour of your data in an object that provides properties, events and methods, meaning they can be reused easily. They are also far superior at managing complex object types e.g. The IDE uses a File object with has Fields which have rules which have ranges and so on. When something in the object changes an event is fired. This can be detected by any part of the application and dealt with accordingly.

Defining a data model takes time up front so it can feel counter productive, however, the benefits far outweigh the effort in making the model. The result of using a data model is far cleaner code that is more consistent and far simpler to maintain.

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply