Question

I'm primarily a desktop application developer but I've been doing some web design projects recently and realized that I was doing significantly more switching between files while getting significantly less work done.

Problem:

When developing desktop applications, my favorite part is determining the best design patterns and data structures to use in order to minimize coupling and maximize cohesion. However, with web design, I seem to be all over the place in terms of structure. The large number of required scripting/programming languages has a lot to do with it. Even though I understand them, sometimes it is mentally exhausting getting them to work together perfectly. In just one project, you might use HTML, CSS, JavaScript, PHP, SQL, XML, C#/VB, etc. Then, each has an arbitrary number of files and making a single change in one might require changes in numerous other files. In a world of abstraction, I would think that the whole process would be made much more concise and uniform.

Questions:

I typically use a MVC design so that I can design the view, link all of the triggers to the controller, and work on the controller/model without ever having to touch the view again. Is there a way to simulate this in web design? How well do design pattern from desktop applications port to web applications? Is there a way just to reduce the coupling feeling?

Was it helpful?

Solution

I typically use a MVC design so that I can design the view, link all of the triggers to the controller, and work on the controller/model without ever having to touch the view again. Is there a way to simulate this in web design?

Use event attributes to simulate this:

<div class="view" onclick="controller('click')" onblur="controller('blur')" onload="controller('load')" onunload="controller('unload')" onerror="controller('error')">
</div>

Is there a way just to reduce the coupling feeling?

Use different languages for each level, such as:

  • XML for the Model, XSLT for the View, CSS for the Controller
  • JSON for the Model, JSON.parse for the View, AJAX for the Controller
  • CSV for the Model, FTP for the View, Socket for the Controller
  • Logfile for the Model, SVG for the View, Perl for the Controller
  • SQLite for the Model, CSV for the View, Spreadsheet for the Controller
  • hTurtle for the Model, GRDDL for the View, jQuery for the Controller
  • Gateway for the Model, PubSub for the View, Proxy for the Controller
  • Metadata for the Model, Metaobjects for the View, Metacharacters for the Controller
  • Dictionary for the Model, Hashed Array Tree for the View, Dispatch Table for the Controller
  • Cache for the Model, Template for the View, Filters for the Controller
  • URLs for the Model, URITemplates for the View, URITemplate Parser for the Controller
  • Recordset for the Model, Heredoc for the View, Higher Order Functions for the Controller
  • indexedDB for the Model, HTML for the View, JSON.stringify for the Controller
  • HTML for the Model, CSS for the View, CSSOM for the Controller
  • data:URIs for the Model, HTML for the View, CSS for the Controller
  • XML for the Model, SVG for the View, SMIL Animation for the Controller
  • URLs for the Model, Request Body for the View, Request Headers for the Controller

References

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top