Should I write a template for the MVC pattern front end?

Source: Internet
Author: User
Recently to a company, the team is in a stage of development. The current company's development model is the front-end based on the prototype diagram and design of the front-end page, by the technical manager of the rule is the front-end according to the backend needs to divide the page into head, body, menu and foot four parts, and then assign a separate controller to their test page. The front end page is tested and then handed back to our backend development page.

The front-end is only responsible for making the page, many interactive effects, such as Ajax, commit actions, etc. are from the back end to complete, and some such as the effect of the pop-up is the front end of the first independent write a layer of code and the back-end integration into the template, often the template wrote hundreds of lines of JS code, which makes me feel

Secondly, because the front-end page and our back-end template is separate, the current side need to make some changes at the time they are first modified in their page, and then tell us the modified part, if the small change is OK, the change is very chaotic, and the template also has a large number of our back-end added JS code, Changes often result in many conflicts. And because the front-end and back-end are often developed synchronously, the disconnect between the back-end templates and the front-end pages often creates some minor headaches.

At first I thought that the template should be completely written to the front end, they simply write a simple template language and write Ajax interactions according to the structure provided by our backend, so that the interaction can be completely controlled by the front end without too much confusion, but the front-end manager does not think so, he believes that the front end and the backend should be completely separated, The front-end simply makes the page, and even wants to discard the current practice so that the front-end only make a pure static HTML without having to cut the page according to the backend rules, but the proposal was not adopted because it would aggravate the back-end workload and development time.

Want to hear everyone's opinion, the front-end should write a template?

Reply content:

With most front-end insiders (including me), the template (exactly the presentation layer) should be primarily responsible for the front end, which means that not only html/css is done by the front end, JS, Ajax should also be done by the front end. Although there are still many companies, there are separate page refactoring (only to do html/css), but in general this approach has been more and more front-end practitioners questioned and denied.

Of course, the pig is an exception. :) The front end and the back end completely separate, not refers to the backend only to give the interface and data ...

Our approach, backend development negotiates interfaces and data formats with only the front-end development and gives data,Front-end developers write back-end templates or front-end templates, and complete all AJAX requests, user interaction.

Make a purely static HTML page, not to be called the front end. Let's get a job.
Your company has no front-end, only transduction and programmers.
You are treated as a transduction.
If you are interested in coming to Ali, you can send your resume in private. Come here in a disorderly spot.
I think, if your front-end manager's concept is the front-end only responsible for static demo output, think that the front-end development is just html+css+ a small amount of JS, then, I think you should find a way to get rid of this manager, or retreat for a project.
My point of view is that in any Internet project where the user experience is pursued, the front-end team must take over all of the presentation layer's business, including the client-rendered template and the view layer on the server side, because only the front-end is taking over the business to better optimize the Web performance.
As long as the front-end things, the backend do not cross the boundary, that is, JS all the logic, the backend should not participate. Who cross the border, chop his hands and throw them back.

Of course, the pure static demo can also be modular, the previous days to reply to a topic, you can refer to. But I don't really want to write that use document. No why, think too simple, oneself ponder bar.

Grunt How to do static resource location configuration? -Front-end engineer team The strength is too bad so it is, typical student time development sense ....


The team lacked a front-end siege Lion, some just transduction. Give Jieyou a resume to experience the pure back-end feeling problems The main problem does not involve the front-end separation, is just a process.

The requirement of their project manager is to write out the HTML file in front, then copy & paste the static parts into their code, and then replace the dynamic with the dynamic code. The dynamic identities are still written in the background. Even the files are two copies, one static, one dynamic.

This is not a front-end separation, but PSD transduction after the generation of sample HTML to the back-end engineer to write the page.

The real MVC template is the template code that should be embedded in the background, which is part of the project.
For example, where the body of the text is {{CONTENT}} The title is {{title}}. Or, like, a little piggy in their project. Use some positional tags to bind data at run time. The front-end and back-end maintain the same file.

And the real front-end separation is that the backend only provides the interface, does not involve the rendering of HTML. For example, using angular JS is one of the typical applications.

If the previous paragraph development understand some of the concept of scripting, it is possible to make changes do not require excessive background participation, improve the development efficiency. But not to liberate the front-end productivity, but to reduce the back-end workload:P come, tell your front-end manager that I fully agree with his point of view, the front end should only write HTML on the line, but, but, this requires the appropriate technology to support, the market you can see the technical framework is not designed for the front-end, It's all fucking back-end engineers writing for their own convenience to fool the front end.

Therefore, we play the liberation of the front-end productivity of the banner sprang out, yes, with the channeling, not to come with me to flee, ...

How does front-end development and background development work together? -Piglet's answer

How to evaluate Knot.js? -Piglet's answer

By the way, I have a comment on the top of the reply below.

Piglet (author) reply He Shijun

You guess our design is outsourced, this is wrong, our design is independent of the team is not fake, but it is our internal team, only so let them independent, because we think engineer and designer is a difference, a good engineer, It is almost impossible to be a good designer at the same time, and vice versa, so that they cannot and should not be mixed with work.

====== Pure Spit Groove =======
Many companies, including Facebook, try to use a full stack of engineers to solve the relationship between the template and the data logic, let the engineer to complete the page part of the work, I have to say, when our designer mm in the landscape, sad autumn months of the cultivation of aesthetic inspiration, we are in the bedroom inside the sweat playing game good , how can you expect us to pull the foot of the great guy to write a beautiful page to ...
==================

So, we've deliberately built this team structure and then started looking for technology solutions, and of course, in that sense, the team structure that you're talking about in turn affects the technical architecture.


He Shijun reply Piglet (author)
So you are not an outsourced team, but as you say the situation of the independent team, with the outsourcing approach is similar. In fact, I am personally very skeptical about this configuration, because I have seen a lot of examples of such configuration to get bad results (whether it is outsourced or quasi-outsourced internal independent team), but I do not see your actual work situation I also do not qualify for evaluation is.

Pig (author) reply He Shijun Well, the bad things you see are taken for granted, except for the two frameworks we have in hand, no other framework fits this kind of team structure, or why we make our own frameworks. As for saying that we are not successful, my self-evaluation is amazing. The existing technology stack is engineer-oriented, forcibly stripping the design part must be the result of tearing the skin bleed. But on the other hand, you can see a lot of failure cases, it shows that this structure is a need, so we will try, I think, we are a handful of road. Further, due to the fact that the existing engnieer-oriented technology stack does not support the stripping design, the experienced technical director avoids the team structure, and from this point of view, the actual demand for the separation design should be much more than the case that we see just a failure.
Look all complex, Division I only transduction and other positions are Java Junior Software Development engineer, do is javaweb work,
Write all kinds of code and provide controller.
And then run to do the Ajax of the page to get data, event bindings, and so on.

The UI team only provides a static page, there are some simple action events (select all, single selection, Bullet box), and finally let the back end of the people to get all kinds of javascript ...
Dry for a year, write JS more than Java, and development is back to the end, you also have designers afraid of what, we directly follow the prototype map to write the page, and then to develop, finally all the process is finished, and then is the page style, typesetting, God Horse, hurt – a week, on-line
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.