monx663 has asked for the wisdom of the Perl Monks concerning the following question:

Hello experienced developers,architects.
I am making mods/updates to an existing cms/web application framework and need some wisdom.

The framework in question is tried and tested but needs "modernization". For example, AJAX connectivity of its web UI elements.
The ability to serve as a mobile application hub is also very imminent.

And here comes the question. Is it better to expose the relevant methods of the various business objects via JSON? Is it better to create web objects that know how to render themselves based on the JSON data they are fed from the server?
I am guessing that an Android or iOS app would expect to only be sending and receiving data on RESTful URIs. And its application display objects would be "drawn", according to the data they receive from the server. The web framework in question, despite being quite old, utilises the MVC model and is quite good at managing web forms etc. However, since the framework will now be serving both web browsers as well as mobile apps, the "View" layers need major reworking.

Does anybody want to share their thoughts on my issues?

Replies are listed 'Best First'.
Re: Perl JSON mobile apps
by marto (Cardinal) on Feb 08, 2021 at 18:38 UTC

    Can't you just make a reactive, 'mobile first' site that works on phones, tablets and desktops without needing users to install an app? Things like Bootstrap can help with that.

      Thanks for the helpful input, guys.

      I was reading up on AngularJS and React, the other day, as I've noticed the latest "trend" of moving away from app stores and into browser based apps, instead.

      The thing that got me worried in a way, was the fact that both of these front-end frameworks seem to try and lock you into a technology that is not controlled by open standards. But are corporation attempts (Google and Facebook) to wedge themselves into the programmers' logic.

      It sort of reminded me of how Microsoft attempted to control the web by "forcing" many web developers to use VBScript instead of ECMA/Java-Script.

        I don't know your business, but I do know that a lot of users are getting sick of installing a different app to use each site, when the back-end is the same as the web based system. Bootstrap was just an example, I've used it and it doesn't dictate anything relating to the perl/server side of things. If as like you say you are happy with the MVC setup you have in place, you should be well placed to replace the existing front end with one which caters for all clients. The benefits in terms of support an maintainability in terms of one thing vs a website (catering for various browsers/devices) and multiple app platforms is quite clear.

Re: Perl JSON mobile apps
by alexander_lunev (Pilgrim) on Feb 09, 2021 at 05:26 UTC
    I would suggest you to look at Quasar framework, and Mojolicious as a backend (with SQLite or PostgreSQL DB) serving JSON for frontend application. Quasar is based on a Vue.js, and can build not only a Web application (which could work as PWA on mobile platforms), but also an Electron application.