If both application.yml and bootstrap.yml exist, who will overwrite whom with the same attributes? - spring-boot-2.6.0

I tried locally that the application will be covered, but when I checked online, many people said that the bootstrap would not be covered by the bootstrap, so I was very confused.
Is it because of different versions?

In fact, this problem is the priority of the springboot configuration file.
In springboot, the priority of bootstrap is higher than application, so if both parties have the same properties, bootstrap will be loaded first, then the application configuration will be loaded, and then the same properties of the former will be overwritten Lose.
The springBoot convention is greater than the configuration, the configuration follows from the inside to the outside, the outer layer covers the inner layer, and bootstrap is configured in the spring applicationContext stage, while application is configured in the application layer, so the external will Replace the inner layer.

Related

Using angularjs/react in a plguin based asp.net core application where plugins can be deployed independantly

Application is being built using .Net 5 MVC & Web API. Application has a plugin system which is organized as below.
[Starting MVC Application]
|__MainLayOut
|__Modules
|__Plugin1
|_Binaries (Web APIs, MVC Controllers, logic, db access local to this plugin)
|_Views (has shared, _viewimports etc.. local to this module)
|_wwwroot (has static files local to this module)
|
|__Plugin2
|_Binaries (Web APIs, MVC Controllers, logic, db access local to this plugin)
|_Views (has shared, _viewimports etc.. local to this module)
|_wwwroot (has static files local to this module)
As you can see plugins are self contained (ex:- if you delete a plugin directory and restart the app) Any features related to that plugin will not work. (Also you can just zip the entire plugin directory and deploy it with some config file changes) Common features like User management/ Permissions etc. are provided to plugins via the main app.
As of now UI is rendered from server and WebAPIs are being called by the MVC Controllers and MVC controllers talk to Web APIs which I don't want to do when I am actually going to develop the final app.
My problem is I can move the UI part and do it as an Angular/React app. but then I can't use the plugin system that I have now. If I can do that, I should be able to break the angular/react components to different physical locations (plugin directories) and then be able to distribute those independently so that upon deployment client app will identify plugin related angular/react code and then load/run as necessary.
I couldn't find such example out there. They all have a separate Angular/React app. The other option I was thinking is to use RequireJs and AMD pattern where I can modularize my javascript code in different plugins. Main UI rendering will happen at server but client will take care of WebAPI calls getting data and binding. However this will not give me MVVM change detection which can be very useful.
So can I use Angular/React in such a way that I don't create a separate app, but use angular code in the existing app, create angualr/react modules in different plugin directories and get them to work together?

is it possible to create a PWA in angularjs?

I am new to PWA, i am curious to know that is it possible to create a PWA in angularjs?
please provide steps to make PWA using angularjs if it is possible to create PWA using angularjs.
There's nothing framework-specific about PWAs - your site just has to meet a certain set of criteria:
Everything is served over HTTPS
The design must be responsive
Your app must be available offline (i.e. it needs a Service Worker)
You need to provide a manifest file containing metadata about your application
Your app must work in all modern browsers
Page transitions shouldn't block the app (i.e. you need to show loading screens/spinners if things are taking a while to load)
Each page in the app needs a unique URL
All of that is achievable with Angular 1 - it'll probably be easier with a modern framework, but there's nothing stopping you sticking with what you've got, for now at least.
look at this github project https://github.com/addyosmani/angular1-dribbble-pwa

What is the optimal architecture combining Scala-Play and AngularJS?

I have recently worked in a pure Scala-Play application and later in a pure AngularJS application. I'm very impressed with both and I'm wondering what is the sweet spot of combining the two frameworks together. Since the two frameworks can be complementary but also overlapping in different areas e.g. MVC and page routing, as far as I know these are some of the possibilities:
Single Page design, use AngularJS MVC-only and use Scala-Play as "dull" service layer backend with no full page refreshes.
Allow page reloads and each page reload becomes a different AngularJS root application. This seems quite flexible e.g. the client side is not bloatted with so much data for larger applications but better partitioned for the different use-cases. The downside is that I'd need different AngularJS MVC applications and I'm not even sure how to organize it as a project. Are there examples of this?
Typical server side Web App, use Play MVC-only and AngularJS for handling UI models for each separate page.
My choice of IDE for these types of architecture would of course be WebStorm but unfortunately I can't have all client-side (AngularJS and JavaScripts) and sever-side (Scala-Play) codes in a single project.
I believe that there is no the ultimate optimal architecture for combining Play and Angular. It depends on the specificity of the project, team etc.
The decision to develop UI part with Angular and the server side back-end with Play is very reasonable. Technically it may be done as following:
Development:
Both parts are developed as detached projects with the preferable IDE.
The client should have some entry point HTML page. It is reasonable to name it index.html, but is may be any other name.
For client-server integration do on the Play side as following:
Select a sub-folder under the play application root, which will serve as the "home" for the client files. The default solution is to use the folder public, since all files under it are automatically deployed.
All client files should be copied under the public folder. The files may be organized in any structure.
Add a route for the default URL as a route to the index.html. The argument path in the route should be the full path of the index.html relatively to the application root.
If index.html is directly in the public folder, the route is like this:
GET /defaultUrl controllers.Assets.at(path="/public", file ="index.html")
Add routing to the client files:
GET /*file controllers.Assets.at(path="/public", file)
Now the distribution package will include all the client files.
Putting of the client files into the public folder should be done automatically, for example by organizing the client directory structure and appropriate configuration of the client IDE.
You can find more examples in this post.

Angular: how do I init module (or service) with parameters?

I need to create a module that will be used by different applications.
Each application is using its own set of vars (application name, REST urls, ...).
How do I set inner variable, by the hosting application, in module (or in service)?
Need to init these parameters as soon as possible as the application loads.
Thanks.
In your module have a provider. That way the client application can bootstrap configuration.
Read the "Provider Recipe" section on angular's site for an example of this.
You should use the Provider recipe only when you want to expose an API for application-wide configuration that must be made before the application starts. This is usually interesting only for reusable services whose behavior might need to vary slightly between applications.

Manually create modules and their dependencies with angularjs

We do a modular application where the UI is divided in components/modules like billing area, staff management, real time charts, shipment etc... The customer pays for this component/module and only the modules he paid for shall be loaded on client side. I name these paid modules "main modules" on client side because every main module is route/button to sub content where user with different claims can do different things.
What I would like to do now is before angular is initialized I would like to manually create the modules basing on the array of licensed module names. Those modules who are not licensed are not created.
Here I have an understanding problem and can not find any similar case in google.
1.) How can I tell angularjs to load a specific module with all its attached controllers/services and their depending modules?
2.) What happens with the common javascript includes which will cause an immediate creation of the angularjs modules?
User #mpm put me on the right track. Its the best if all the files belonging to a angular module are copied over to the index.html before the body tag before the Index.html is initially sent to the client side. That way the client does not know about how the modules are loaded. It just gets the modules... Only the server knows and is doing still more stuff about the modules to be licenced like loading only the module depending endpoints/ApiController`s.
To second this answer as a recommend approach, you can watch this video:
https://www.youtube.com/watch?v=62RvRQuMVyg#t=486
from the angular conference where they recommend the same approach :-)

Resources