|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| v20 MVP RAD - My initial thoughts |
| Iniciado por guest, 04,may. 2015 14:17 - 3 respuestas |
| |
| | | |
|
| |
| Publicado el 04,mayo 2015 - 14:17 |
As many on here will know I am by no means an OOP guru. However its a long weekend in the UK owing to the MayDay holiday so thought I have a go at the new V20 MVP Rad
Overall I have to say I find it pretty impressive and it will, as advertised, generate all the necessary classes and methods required.
Now this is RAD so there are some limitations.... Currently it is not possible to generate a full application, possibly in a future release but I do not know, so each file has to be accessed individually. It allows for the creation a Table control window or a Form window. This is fine for basic Menu>Open Table>Open form apps even for MDI but if you have more complex UI's or use internal windows then 'cut&paste' will have to be your friend.
New>Window>Window>RAD>MVP or direct from the analysis opens the wizard. Recommend you do the Form first as buttons (Add, Modify & Delete) on the Table window look for this.
It works pretty much straight out of the box and allows as the buttons would suggest for the addition, modification and deletion of records. NOTE: If you open the window from a menu window (you have to do your own) just use Open(MyWindow) with no parameters. If you run in test mode leave the default 'gclPresenter with test value of *' selected. If, as I did to begin with, you uncheck this then the window will not function correctly - Strange to me as no param is required when opened from a menu.
Now I say 'works pretty much' as I did find some short comings in the generated code.
1. When adding a record to a table that already has rows displayed the selection bar always returned to the previously selected record not the new record entered.
2. If a sort had been added to the query and a change is made to a 'Sorted' field then the selection bar returned to the row original selected and not the modified record.
3. Following addition or modification the table display only returns the records original fetched when the window was opened. OK for a single user but not for a multi user as addtions/changes by other users are not shown.
A challenge thought I so armed with pencil and paper I commenced stepping through the code. First issue is to get used to the naming conventions used and trying to understand the new functions, key words that are being used. Quite a bit of this is not documented for example.... In the Model (File) classes each field is mapped i.e. m_idCustomer is 8-byte int
In code the access is to the given name M_idCustomer but now when adding of modifying a record the syntax used is HAdd(MyMappedFile) or HReadSeekFirst(MyMappedFile,MyMappedUniqueKey,UniqueIdentifier), HModify(MyMappedFile) - quite cool I think.
The other part I found interesting is the new 'Request for refreshing the display of WIN_xxx' in the window code. Used together with the new functions RequestUpdateUI() and ExecuteUpdateUI() this allows for this to be called anywhere in the classes and automatically run the code when at the end of the calling process.
Anyway to cut a long story short (I can now barely see the F7 on my keyboard) I found that by making changes, 1 in the window code and 2 in the table method codes, I could quite easily overcome the above issues. No real work as I was still able to use the generated functions/members - just called them in different places and added an ArraySeek().
I have sent this revision to PCS as a suggestion for change - not sure how I will get on with that one so as plan B I now have these in my CodeBricks.
One last thing, quite amusing really, is that with v20 you get 2 examples WD_Discovering MVP Part 1 and Part 2. Firstly Part 1 is actually the basis of Part 2 so not really worth bothering with and, the amusing part, is that neither actually appear to have been created using the MVP RAD.
What Part 2 does contain however is a method to display a linked table from the selection of a single record in an exiting table. Not part of the RAD generated as this is Table to Form but with a bit of cut&Paste into a CodeBrick, job done.
Finally another thing I noticed is now that when in the debugger if you double click on the current 'gclPesenter = Display layer' it displays in tree form all associated elemnts form the MOdel and Array classes.
So there you have it - my thoughts on MVP RAD. Be interesting to see what the more experienced OOP people think. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,mayo 2015 - 16:03 |
Hi Derek,
Thanks for your insights... What holds me from investigating on it, is the fact that this feature is WinDev only which is completely against the paradigm that PC$ is trying to sell itself: Multi-platform development using a single toolset.
The future of applications are (if not purely web based) hybrid (fat client, web, web services, mobile (iOs, Android, WP)... Having a solution that only works in one of the three products is a showstopper for using it for me...
Just my 2 cents,
Peter H. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 11,mayo 2015 - 16:07 |
Hi Peter,
We do MVP since version 17 of WinDev. So you can do it even without the new MVP features. (In fact, version 20 brought nothing new to us.)
The new "MyMappedFile" and "MyMappedUniqueKey" are nice but you could do it exactly the same with standard ancestor classes (two simple lines of code in the class constructor).
The new RequestUpdateUI() and ExecuteUpdateUI() are also nice but unfortunately they do not work (yet) in some real world implementation where it becomes more complex than the very simple use case of the actual RAD and demo programs (like using Internal Windows). But you can live without them too with the same low-level class functions from an ancestor class.
So you can use MVP with your actual version of WX. We also do not use the "table presentation" because it is not efficient. We use direct queries for display (more efficient) and when the user makes an action of selection, we simply create and work with it's internal representation. This is the best you can actually do in WX with MVP. But you can go the full table-presentation way if you wish to do so, I just found it not quite good when you have lots of records to display (depending how you build and display your data, the needs will be different).
Best regards! Alexandre Leclerc |
| |
| |
| | | |
|
| | |
| |
| Publicado el 11,mayo 2015 - 17:12 |
Hi Alexandre & Derek,
Thank you for your insights... It seems you have built your own MVC framework over the years just like I have...
I'm using a similar framework for years in WD and WB. Although it is not fully MVC compliant, you can find my WX framework doing similar stuff and working for as well WD as WB here: http://repository.windev.com/resource.awp…
It is free for download and use as a starting point for any WX development. A video tutorial can be found here (Webinar 129): http://www.wxlive.us/component/jdownloads/viewcategory/7-recordings-streaming-videos… or here:
An update (especially on the WB samples included) is foreseen in coupe of weeks.
Cheers,
Peter H. |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|