Hi, in the last weeks I’ve mastered the art of component creation to a very high level. Such a level that I’ve become a dangerous developer . I feel the urge to make components for everything.
The underlying truth is that components are very easy to manage, but my Ember experience is very short, so I’m not sure of what I am doing.
For example: I have a very big Product table, but i don’t want a gigantic Input/Edit page.
-
I want the “Show Product page” to be built using different pieces or modules, visually separated.
-
The Input/Edit forms are small modals that pop from each one of the “modules” in the main “Show Product page” (prices, multimedia, texts, comments, history, etc.)
OPTION1:
My initial approach (coming from a “procedural world”), was creating a big "Show Product template, with all the fields. My modules should be just visual pieces separated by HTML/CSS structures. The only components should be the modal forms to edit data.
OPTION2:
But now I am the master of components! I can also build my thematic modules as Ember components, with enclosed "show "and “edit” functions. The edit forms should be nested components inside each module. This way, the Product template will be just a clean and schematic container with calls to load components.
To follow the DDAU paradigm, the final “save” to persist data should be in the Product Controller, using clossures down to the nested forms. I think it’s easier if each module can save data, but I prefer playing by the common rules.
MY DOUBTS
Theese components will not be reused anywhere in the application. And reusing things is one of the main reasons for all the component theory. Thats what I’ve read, isn’t it? In this case, components are just an organizational tool.
When things go bigger, I do not know if my components addiction will be a problem somehow. For example, with the components directory growing and growing exponentially.
I like the idea of “ambitious web applications”, that’s why I’m here. There is a lot to learn before that, but I am ambitious from day one, and I will greatly appreciate some real world advice until I can make my own decisions.
Regards: Nacho B.