-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
export class MyApplication extends RestApplication {
constructor(options: ApplicationConfig = {}) {
super(options);
}
}looks much better from a users's perspective, than:
export class MyApplication extends BootMixin(
ServiceMixin(RepositoryMixin(RestApplication)),
) {
constructor(options: ApplicationConfig = {}) {
super(options);
}
}Mixins are our tools for composability; it is a great pattern for the people developing the framework but is not a great DX for the users of the framework, especially new users. We should shield them from internal implementation and present a simple RestApplication class, which they can use for creating their REST apps. RestApplication should then be documented as a first class entity (almost as LoopBack itself). Not suggesting we should modify the current RestApplication, just a name used for the example.
"But LoopBack can be used for creating other types of apps that may not use services and/or repositories."
The majority of our users are looking to use LoopBack for developing REST apps, even our app scaffolder creates a REST app by default. Therefore RestApplication should be a principal in the framework.
In my opinion, the confusion in the current documentation is caused by the drastic differences in the view of what LoopBack is, according to "us, the developers of the framework" and our users.
Users: LoopBack is a REST framework.
We: LoopBack is a powerful framework that can be used to build all sorts of apps. REST apps are just one of the many possibilities.
The organization and content of our documentation is a correct reflection of our view, but our users are looking for the documentation of their view.
That makes me wonder if creating two identities out of the current work would help.
- LoopBack - the REST framework.
- A meta framework, which can be used for creating LoopBack and other frameworks.
Now creating LoopBack apps would look like this:
export class MyApplication extends LoopBack {
constructor(options: ApplicationConfig = {}) {
super(options);
}
}A documentation around the LoopBack class is what our users are looking for. The current documentation is that of the meta framework.