I'm working with a component "architecture"/"framework" (not mine) and need some feedback on it - specifically whether it violates any best practices in the programming/architecture world. Also, why it is better/worse than another version.

Here is a sample bit of code: HTML:

<form data-renderer='formrenderer'>
    <div data-renderer='hformitem'>
       <input data-renderer='numberinput' data-id='theInput' data-label='some.key.to.translate' data-required='true' data-max='9999' data-min='0' data-name='someName' type='text'>
    </div>
</form>
<button data-renderer='bigbutton' data-id='theButton' data-role='primary' data-background='black' data-text='some.key.to.translate'></button>

This HTML is sent to a 'parser' that replaces all of the pieces that have 'data-renderer' with 'enhanced' versions. Later, to get/set values...

JS:

var inputComponent = someContext.getComponent('theInput');
inputComponent.setValue('foo');
inputComponent.getValue(); //would return foo

The simplified version is: HTML:

<form>
    <div class='form-item required'>
        <label for='theInput'>{{i18n "some.key.to.translate"}}</label>
        <input type='number' max='9999' min='0' name='theInput' id='theInput'/>
    </div>
</form>
<button class='primary important'>{{i18n "some.key.to.translate"}}</button>

And the JS..

$("#theInput").val(); //setter/getter of course.
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.