I don't want to go too deep into the detail because what it actually does is very specific to the lab. There is a lot of data I'm wanting to collect, select, connect and commit to a database. Which is very bog-standard for my web work.
Thing is, it is a lot of state that I want to put together, and I hate putting together lots of state iteratively via repeated web inputs, because each time you go back to the server, you increase time and annoyance and the potential for catastrophe. So, I really want this to be an AJAX-lead mostly-javascript thing.
You want to know the absolute coolest thing about coding Javascript? You can put it all together via Javascript. You can have a page that looks like <body></body> and have absolute control over everything on that page. It is true that, when you do that, this means that people who run without Javascript get absolutely nothing, and this is a problem, but there are times when you can create something in HTML with some small Javascript additions that are not necessary, and there are times when putting it together in Javascript is the whole of the point and re-implementing in HTML and CGI are just in the way.
Except....
We are experimenting with MVC frameworks, very specifically Dancer. We've seen and done enough with Dancer to decide that this is the way we want to go with new web development. In a way, I'm pushed, but in another way, I see this as accepting the change of technology. I don't want my skills to be rooted in the early 90s more than they already are. So, I for one welcome the new MVC overlords. But I'm seeing a Template Toolkit page that says <body> <!-- Insert Cool Stuff Here --> </body> which kinda obviates the purpose of making it dynamic like that in the first place.
Right now, I'm thinking through the data, deciding on the right way to make and modify the database tables to get at it, and mocking up what I want it to look like in straight HTML, but I am getting close to the point where I have to make that decision, and the way isn't clear to me.
Well I haven't tried Dancer although I hear lots of nice things about it, however, if you want to go down the <body/> route you really have to think of your server side web app as an API, you can add in more tech and buzzwords like RESTFul and Websockets and other such Shiny but essentially it boils down to providing an API for remote Javascript clients.
ReplyDeleteIncidentally I've recently been using the other new(ish) kid on the block: Mojolicious for this sort of stuff mainly because of it's excellent support for above said Shiny, maybe Dancer does too.
That is a crucial part of it, yes. Well, mostly. I think RESTful is important for these APIs, with EVERYTHING YOU NEED put into the URL, holding onto as little as possible. Websockets seems more toyish to me, but I could be wrong. But the bold strokes? I'm with you.
ReplyDeleteI don't think I've tried Mojolicious, but I have tried Catalyst, and I never got to the point where I could depart from the script and develop my own stuff. Never got to Mojolicious.
Have you looked at Jemplate?
ReplyDeletehttp://search.cpan.org/~frew/Jemplate-0.262/lib/Jemplate.pm
I haven't looked at Jemplate. I just might.
ReplyDeleteBut...
After talking with my coworker -- the one who would have to support this mess should I move on -- the lab has decided to make this as much Perl as possible and as little Javascript as possible, and I believe that Dancer::Plugin::Ajax will serve those needs.