How would you organize a large complex web application (see basic example)?

前端 未结 4 852
北荒
北荒 2020-12-22 18:19

Just to keep things interesting and close my final open question, the solution that implements the below functionality in a nicely organized manner with a decent architectur

4条回答
  •  不知归路
    2020-12-22 19:22

    Matpol gave a literal solution to the specific information provided. Your edit implies that you are looking for an answer to a more hypothetical question. In other words, you're looking for the "approach".

    Answering the question in this manner; the single example you gave is a bit of a red herring. It is but a single item in the whole app, and prevents us from "seeing the forest from the trees". So what is the Forest? The question, asked as such, doesn't define it. But I think all programmers will agree when I say it's a nightmare to work on a project that has no definition. So, I'll rephrase your question and answer, "What is the process for defining a project?"

    Mine is, in fact, asking a series of questions:

    • What is the core purpose of this application?
    • When do you want it launched? If we had to launch it in 1/4 that time, which features would you keep?
    • Which features are you absolutely certain you're going to need afterwards?

    A lot of the time, to get to the bottom of those questions, I need to ask other business questions:

    • Who is your audience?
    • Why do they care about this site? What's going to keep them coming back?
    • How are you going to generate revenue?
    • What is your call to action? If you could funnel all of your users down a single path, which would it be?

    Hopefully, these questions will result in a set of foundational code that you can consider your core. Your core, as you suspected, probably doesn't fit the modular approach. And as you identified, you will want to break that core down into a Model / View / Controller layout.

    But it's inevitable that you will need to add design fluff. And this brings us back to your code example - its fluff. Fluff belongs in a plugin, separated from the core. This isn't to say that all of your plugins should be delivered to the user in separate js files... but for your development purposes, they should be viewed as modular, and independent from the core code base.

提交回复
热议问题