6

Q. Using vanilla javascript without any frameworks - what is a pattern for large scale component based architecture?

I understand the idea of components being split out into individual sections, and having their own structure, methods and api. However I don't know how to tie it all together. Where does the business logic reside? How do you structure the project, where do you include all the methods etc.

My experience is monolithic whereby everything is coupled too tightly. Any clarification on this would be much appreciated, feels like I'm running around in circles.

Note: When I'm talking about component based architecture, I'm referring to this idea

2
  • 1
    I can answer this from a vue.js perspective. All the stuff resides in a the view and a component is just one part or even one element of the layout. In the end, it's all the same, vue still needs routers, angular is a full FW, the end result is what matters. The best of all worlds is, if know JS and css, to just use node/express/ejs and a psg/mongoDB/sql database. This blows all the above thing out of the water, you can just render the html from the server side. Ive made a video stream app, the index file is 20 LOC. The js/php/mysql took me months, node/mongo took me a day. Commented Dec 1, 2017 at 9:46
  • Thanks for your answer - I'm looking for more of a vanilla solution without a framework. It's so confusing that you can't find many large scale component based architecture articles or examples. Commented Dec 2, 2017 at 11:02

1 Answer 1

3

You can read more about Object-Pattern and Module-Pattern

Here is a link to a lot of common patterns:

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer - although I forgot to mention it above, I'm looking for more of a functional programming solution. Although this is very helpful, I have already read Addy Osomani's book.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.