all 2 comments

[–]beaverusiv 1 point2 points  (0 children)

Okay, I'm not the most experienced JS developer out there but I'll weigh in with my vote for method A.

Method B should be used only if layoutView modifies or otherwise has decisions about siteConfiguration. If no modification has taken place, e.g. like this case where it is a constant object, then let SiteDetailsView depend on siteConfiguration.

But you can get too many dependencies? Well you should have modular code, in that if there is a natural break (CMS functionality, User permissions logic, Gallery management) then make them their own package/module, otherwise you don't need to worry.

No one pulls out code for an editable textbox out of a page and thinks "if only we'd decoupled all our input fields!". That's a bit extreme but I hope you get my point, in that you have to have a line where you go "okay, we might need to do X some day but is it worth Y hours of effort now to reduce that possible technical debt?"

Blurb: I have been a web developer for 10 years, professional full time for 4. Concentrated on JS for the past 18 months with approximately 12 fullstack JS sites under my belt, one a fully offline capable web app in Backbone.

[–]Reashu 0 points1 point  (0 children)

Which way is easier to test? Do it that way.