-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spike] Give bottom-up examples in Controllers.md, Routes.md, Repositories.md and Decorators.md #1173
Comments
AFAICT, Controllers describe code-first approach too, see http://loopback.io/doc/en/lb4/Controllers.html#writing-controller-methods. Having said that, I agree the page may need some reorganization to increase visibility of the code-first approach and decrease visibility of the design-first approach. Similar comment applies to Decorators too - we have examples showing code-first approach, see e.g. http://loopback.io/doc/en/lb4/Decorators.html#operation-decorator. |
I'm thinking that the code snippets shown in our documentation can be more coherent. For example, if the todo example contains most of the code we need, maybe it's a good idea to reference the code in there, i.e. copy the code snippet over and mention to users the location of a complete example can be found. Another advantage of doing this is we do not need to spend significant amount of time to validate the code snippet for each doc, as long as we've tested the todo example (for example) is good. |
We should have a tutorial showing how to build applications bottom-up way. @raymondfeng could you please add more details about what such tutorial should include? We already have Todo example, what do we need to change or add to make that example good enough as the tutorial? |
I suggest that we create a tutorial following the narratives below:
|
With the exception of the second step (add decorators to controller methods), such tutorial is already available in the top-down version here: http://loopback.io/doc/en/lb4/Implementing-features.html We could copy that page and rework it to show bottom-up approach, but then we would end up with a lot of duplicated content. For long term, I think we need to find a way how to show both top-down and bottom-up approaches in a way that allows us to keep shared sections in a single place. In DP3, top-down approach is out of scope, therefore we don't need the current content in Implementing-features. I am proposing to rework that page to use bottom-up approach and maybe change it's style so that the page reads more like a tutorial than a best-practice guide. Thoughts? |
Let's keep discussion and revisit it in the next meeting. |
@raymondfeng based on your comment:
Do you want a new tutorial that following exactly the order from 1 to 6, meaning define controller first then the model and repository, or the order of creating artifacts doesn't matter? If ignoring the order, I think we already have such a tutorial called "Todo Tutorial": http://loopback.io/doc/en/lb4/todo-tutorial.html Is it the ideal tutorial for you? |
Hi team @strongloop/sq-lb-apex @raymondfeng @bajtos @hacksparrow , after following the conversation above, I think we at least agree on make the api first approach(top-down) less visible in the 4 documentation pages list in #1173 (comment). I would also suggest we don't document a concept in a way that the code first and api first approaches are mixed, they can be on the same page, but in two separate sections, so readers can consistently follow the supported approach to build their code, and read more about the other approach if they are interested. Based on the current acceptance criteria, I would suggest modify it to For the docs
Thought? |
I think you meant top-down code examples should be moved to less visible sections? The proposal looks good to me. To be honest, I think it would be more effective to sandbox this task to a certain amount of time and let the person working on the task to decide what's best, rather than spend so much time and effort on coming up with clear acceptance criteria. |
From last estimation meeting:
|
I agree with @bajtos in comment #1173 (comment), while a quick spike would also give the story owner a much clear scope, so I did the quick spike as we discussed last time. |
@jannyHou , so your above comment is the acceptance criteria of this task? |
Description / Steps to reproduce / Feature proposal
RestServer
; very often in these docs, an OpenApi fragment is defined first and then registered instead of having it automatically generated.Acceptance Criteria
Controllers, Routes, Repositories, and Decorators
@get
)Controllers
andDecorators
),simply delete the top-down example and bring up the bottom-up example in its placedelete or move them to a less invisible place(case by case)Quick spike
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: