Author Topic: Web app development framework  (Read 2732 times)

Offline littleguy

  • Developer
  • double
  • *****
  • Posts: 1945
    • View Profile
Web app development framework
« on: August 15, 2013, 03:20:45 PM »
@Paul and anyone else who knows a thing or two about this stuff...

I'm looking to build what I'm guessing is a straightforward web app.  The user will fire up a browser and fill out what is essentially an adaptive questionnaire.  That is, they will be greeted with a standard web form with text boxes, radio buttons, etc., and whenever they fill out a field, some new fields will be shown and/or re-ordered and some output displays will be refreshed with new numbers.  Users can populate fields in any order, and the decision about what gets shown next isn't something that can simply be hard-coded (e.g. a tree structure, lookup table, etc.).  Rather, the decision is made by a server-side algorithm that interfaces to some third-party library (bindings for Java/C/C++/C#) and a database.  The server will almost certainly be a LAMP stack, though I suppose nothing has been ruled out yet.

I can't imagine this being a challenging task for anyone with a bit of web app experience.  We could always farm this out to a subcontractor, though there are some technical and strategic benefits to doing it in-house even if we're not web dev specialists.

So my question is, if we do it in-house, what approach would you take?  Obviously we could code HTML files by hand, but in this day and age I'm guessing there are a lot of higher-level frameworks where all the nuts and bolts are already done for you and you can focus on the general architecture and business logic.  Our main priorities are flexibility and maintainability, since this might evolve significantly over the next few years into something much grander.  I don't mind sinking some up front time to climb a learning curve, and long-term I imagine it best we invest in html5 or at least AJAX approaches.  Paul, you mentioned Symfony2 a couple weeks ago, sounded pretty enthusiastic about it.  Does that fit the bill here?  Basis for comparison?
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3491
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Web app development framework
« Reply #1 on: August 15, 2013, 08:07:56 PM »
Symfony2 would certainly work for that type of project, but it is a somewhat complex framework to learn initially (at least it was for me), so if you are just looking for a quick solution to the one requirement, I would probably suggest something with a smaller initial learning curve.  You might look at CodeIgniter, which is focused toward rapid-development projects (when something needs to be done fast, I always use CodeIgniter).  It isn't as object-oriented as Symfony2 though, and you work with the database at a somewhat lower level.  I am a little biased toward PHP for server-side processing, as you can tell, so I'll let anyone else chime in if they have experience with other languages and frameworks.

For the front-end you would want to set up a header and footer template that is reused and applied to each view (usually a banner, menu bar, and common style sheets and scripts loaded from the header, and contact info or links in the footer).  These templates are reused and applied to every view.  The templates themselves you could use a higher-level editor if you preferred, and export the code for final tweaking.  I typically write these at an HTML-level, though, just because I have more control over the output and optimization (theming a site is typically the easy part anyway, and only has to be done once).  Both Symfony2 and CodeIgniter (and probably most other frameworks) make it easy to use templates.

For styling, I would go with a professional-quality system like Bootstrap (makes it super-easy to throw together high-quality pages)  I usually do a little tweaking to personalize the style to the site.  I've used jQuery UI in the past, but Bootstrap is far superior with a lot more options.

For reactive forms, simply use Javascript to make AJAX calls to functions in your controllers, which make a decision on what to show the user based on what their input.  You definitely want to use jQuery for easy manipulation of the DOM to add and remove elements from the page on the fly.  I typically send post commands to the controller, and respond with JSON strings.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Developer
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Web app development framework
« Reply #2 on: August 15, 2013, 08:32:43 PM »
Coolness.  Exactly the kind of detail I was looking for.

Regarding the learning curve, this is a two-ish year project, and we don't see the front-end as a throwaway or requiring super rapid prototyping.  If it takes months to learn how to implement this stuff in Symfony2, that's probably too much... but a few solid weeks would be fine, especially if it enhances our in-house capabilities on future projects.  What we don't want is something with a glass ceiling that eventually makes it hard to add features at some point.

A few years back I was using Drupal for a neighborhood website.  Sunk a few months into it but at the end of the day the last 5% of the features would have required exponentially more time to implement than the first 95%.  Project abandoned.  I still think Drupal is cool, but that's the type of situation that I never want to get into at my day job.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3491
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Web app development framework
« Reply #3 on: August 16, 2013, 12:27:48 AM »
Ah, yes.  Drupal is much higher-level than what I am used to working with.  Symfony2 has some things that might be reminiscent of Drupal, such as its abstraction of the database (you deal in Object-oriented PHP rather than writing raw SQL queries).  However, it requires a lot more actual coding, and being able to work with multiple languages (besides php and javascript, twig and yml for example).  I am quite enjoying it myself.  It definitely takes the old adage "right tool for the right job" to heart.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Developer
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Web app development framework
« Reply #4 on: August 16, 2013, 07:13:02 AM »
Yeah, I ruled Drupal out right away because I didn't want to write a whole bunch of custom modules.  I figured that would take at least as long as any other framework, and is a more unfamiliar programming model from my and my colleagues' backgrounds.

Symfony2 sounds like it's at the appropriate level from what I can glean.  Looks like Zend2 and Django are roughly similar in scope and purpose (and I'm sure many more).  I'll do some digging on pros/cons but if you had any thoughts I'm all ears.

A veteran programmer in the company has started exploring the Tomcat & Java servlet path.  Seems like older technology, which isn't necessarily bad if it's a good tool for the job.  But Java is her comfort zone, and I don't want to pick something merely on the basis of its language.  Also, if I have to invest time either way, I'd lean towards the current trends.  Strengths/weaknesses?

The object-oriented database abstraction of Symfony2 sounds good.  I've done a lot of low level SQL querying, and have also used high-level stuff like LINQ and MS entity framework.  I'm happy with either approach, though I've found that for any substantial SQL-based project I always end up abstracting the database queries anyhow by the end of the day.  Having that built-in up front would be useful and efficient.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version