How to develop modular web UIs with Django?
Posted
by nh2
on Stack Overflow
See other posts from Stack Overflow
or by nh2
Published on 2010-03-13T13:51:59Z
Indexed on
2010/03/13
13:55 UTC
Read the original article
Hit count: 331
django
When doing larger sites in "big business", you most probalbly work in a team with several developers.
Let's say dev A makes a form to insert new user data, B creates a user list, C makes some privilege administration and D does crazy statistic graphs work with image generation and so on.
Each dev begins to develop his own component, creates a view and a template and tests that independently, until each component works.
Now, the client wants to have all those components on one bit HTML page. How to achieve this? How to assemble different views/templates in a form of composition so that they remain modular and can be developed and tested independently?
It seems inheritance is not the way to go because all of those UI components are equal and there is no hierarchy.
The idea of the assembling template is something like
<html>
<head>
// include the css for the components and their assembly
</head>
<body>
// include user data form here
<some containers, images, and so on>
// show user list
// show privilege administration in this part
// and finally, the nice statistic graphs
// perhaps, we want to display some other components here in future
</body>
</html>
I have not found an answer on the net yet. Most people come up with one big template which just implements all of the UI functionality, removing all modularity. Each component shall have its own template and view dealing only with that component developed by one person each, and they then shall be sticked together just like bricks.
I would highly appreciate any hints!
© Stack Overflow or respective owner