Skip to content

add light-controller application#3

Merged
manohar-narkhede-imgtec merged 2 commits intoCreatorKit:devfrom
mayank-sirotiya-imgtec:add_app
Jun 30, 2016
Merged

add light-controller application#3
manohar-narkhede-imgtec merged 2 commits intoCreatorKit:devfrom
mayank-sirotiya-imgtec:add_app

Conversation

@mayank-sirotiya-imgtec
Copy link
Copy Markdown
Contributor

@mayank-sirotiya-imgtec mayank-sirotiya-imgtec commented Jun 23, 2016

@CreatorKit/creators

Signed-off-by: Mayank Sirotiya Mayank.Sirotiya@imgtec.com

Signed-off-by: Mayank Sirotiya <Mayank.Sirotiya@imgtec.com>
Signed-off-by: Mayank Sirotiya <Mayank.Sirotiya@imgtec.com>
@mar3kk
Copy link
Copy Markdown

mar3kk commented Jun 28, 2016

I don't like the way resources are defined. There is an array containing object definition but I don't see a point having it since there is only one object and one resource. The for loops unnecessary complicate the code which should be simple. But I can understand we want to have generic code so user can add more objects. But it won't work since there are hardcoded values in resource definition like callback, operation (rw), mandatory/optional.

In short I would either generalize more Resource struct by adding pointer to callback function, operation that can be performed and so on. So new objects can be easily defined by extending the array. Or I would resign from array and for loops in code.

@abhijit-mahajani-imgtec @mayank-sirotiya-imgtec What do You guys think? I believe the same applies to led-controller.

@mayank-sirotiya-imgtec
Copy link
Copy Markdown
Contributor Author

Hello Mark,
When we first designed button-gateway app, we did keep everything very specific for the project and it was not at-all generic, but later on we have added some generic behaviour to the projects, which lets the user to understand how the app could be extended to handle more objects. I agree that the current app is not completely generic, as that could make a simple app way too complex to understand and write. However, removing the use of array will force the user to almost re-design it for any extension. As of now, I don't think those for loops would be eating more m/c cycles or making code difficult to understand. However, that is just my perception.
I would consider current design as a trade-off between "way too complex and huge generic code for simple application" and "a simplest hard-coded app which causes difficulty for user to do any extension".

@abhijit-mahajani-imgtec
Copy link
Copy Markdown
Contributor

Yes i agree with Mayank. Its a trade off. We have designed that such a way that it would be easy for extending to various kit projects. just the resources etc will change as per the project specs but general implementation can be re-used as it is.

@manohar-narkhede-imgtec
Copy link
Copy Markdown
Contributor

manohar-narkhede-imgtec commented Jun 30, 2016

Approved and Verified.

@manohar-narkhede-imgtec manohar-narkhede-imgtec merged commit ff50d54 into CreatorKit:dev Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants