We have an architecture where one big application is split into multiple Angular applications maintained by different teams with different deploy schedules.
These separate Angular applications in an ASP.NET context are deployed on a server and run as one big application.
Every application is deployed on a separate app pool and they all have the same layout and framework code.
Each application would use a bundle optimized by using the AOT compiler and a module bundler (rollup or webpack 2).
Each application would also use centralized JavaScript code which needs to be centralized in the big application (framework code). This code would also use Angular components and contain things such as a centralized layout component, multiple angular services making web API calls, etc...
So each application would use this same frameworke code.
The goal is also that when a change occurs to that framework code no single application would have to update and deploy again.
The standard way that I see is that es2015 imports are used and that a module bundler interprets the imports and only adds the necessary code into the module (tree shaking). Mostly the Angular framework stuff that you need is also included in the bundle (no use of CDN).
But in this case there are 3 parties delivering code:
Angular and other vendor code
The centralized custom-made framework code used through all applications also using Angular and also providing a bundle
The application itself providing one bundle
How would you go about to split and optimize the bundles?
Make a separate bundle with all Angular/vendor stuff that the centralized framework code and the application need to use
Angular stuff would be excluded from the main bundle
Use a CDN-like way to centralize the custom framework stuff and referencing that bundle (without angular code in the bundle)
So you would end up with something like this:
<script src="vendor-bundle.js"></script>
<script src="/central-location/frameworking-bundle.js"></script>
<script src="app-bundle.js">/script>;
What is the best approach in this specific case? I cannot find good examples for this kind of architecture setup.
Just use this kind of construction:
<script src="vendor-bundle.js"></script>
<script src="/central-location/frameworking-bundle.js"></script>
<script src="app-bundle.js">/script>;
And use eTags/last modified caching on the frameworking-bundle.js
This way the file is downloaded again if modified.
Users will always get latest version without using versions/hashing/query string. It won't have to do modifications to the code.
https://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/
The frameworking code should exclude the vendor code and the application should define it. In the same way that for example Kendo requires you to have JQuery.
Related
I've segregated my WinUI 3 application into different layers: Application, Infrastructure, Presentation etc.
And all the projects have targets: net6.0-windows and I want to move it to the Uno Platform.
So, I've added a new target: net6.0
And at this moment the problem arises:
Type [WinUI] component already defines a member, called InitializeComponent or some problems with binding.
Is it possible to make such type of library with targets to net6-windows and net6.0?
For the Windows app project itself, you need to use net6-windows, as that provides additional dependencies specific to Windows app projects. All other libraries (non-app projects) can then use net6.0.
Regarding the specific error message, you are getting, the reason might be the generated files have some kind of conflict - you can try deleting the obj and bin folders and rebuild.
The easiest way to make existing Windows app support Uno would probably be to create a blank Uno solution and then migrate the code there (as the solution has already the required setup for platform-specific projects prepared and you can then just add your code.
Uno also provides templates for cross-targeted libraries, so you might be able to use similar approach. The one linked is for "UWP" solution however, so to make it WinUI, you would need to switch from uap10.0.18362 to net6-windows.
What is a difference between bundle, component, service in Symfony? Thank you in advance
Bundle: A collection of code and other files written for use in a Symfony application.
http://symfony.com/doc/current/book/bundles.html
Component: Parts of the Framework that handle a certain task. They can also be used without the Framework.
http://symfony.com/doc/current/components/index.html
Service: Just a php class that provides certain functionality. It can be loaded through the Service Container which automatically handles dependencies.
http://symfony.com/doc/current/book/service_container.html
As I understand:
Components - standalone official libraries that can be used ether separately from Symfony framework or as a part of so called "Symfony-framework-skeleton". They are independent from other libraries.
Bundles - libraries that are additional to "core Symfony". They are dependent from Symfony components.
Services - libraries written by usual users for local projects that can be reused in different projects.
Service is any php class that has a relation with the dependency injection container, meaning that the container is able to manage it.
A component is a self contained entity that has usability even outside of a symfony based application, a library like PDO.
A bundle is symfony flex abstraction for providing simple modularity including configurations and automations.
So a bundle can be made out of a component.
I've seen api-paste.ini as a conf file after installing openstack.
It looks like substituting some prefixes for python implementation but have no clue about this.
Here, my questions are:
What script is it?
it looks like very bizarre grammar like the following:
[composite:metadata]
use = egg:Paste#urlmap
/: meta
How does it work within python script?
See documentation for Paste Deploy.
The api-paste.ini is the configuration for the above web-services framework. Paste.deploy allows you to separate concerns between writing your application and middleware/filters from the composition of them into a web service. You define you WSGI applications and any middleware filters in the configuration file then you can compose pipelines which include the middleware/filters you want into your web-service, e.g. authentication, rate-limiting, etc.
You want to temporarily remove authentication, take it out of your pipeline and restart your web service.
The declaration above is declaring a composite application, but with only one application binding (a bit unnecessary - normally you would expect to see more than one binding, e.g. for different versions of the application). The WSGI application app:meta will be bound to / and you should have a declaration of app:meta later in the file. The implementation of the composite app is declared via the use and the egg:Paste#urlmap is a simple reference implementation.
You load this in your program with paste.deploy.loadwsgi.loadapp().
There is a proposal/recommendation(?) to move away from Paste Deploy/WebOb to WSME/Pecan see OpenStack Common WSGI
Hi i want to know what is meant by modules in a project??how they are classified and how many modules we can have in a project?can anyone explain with simple examples??What modules we can have in a typical online shopping website?
In .net context I believe one can draw 2 meanings not sure what specific you are looking for.
One is modular programming by following design principles like "Separation of concerns", "Single Responsibility", "loose coupling". This means divide you code into classes based on these principles and further group these classes again based on these principles into modules.
In ASP.NET or C# or in general we create class library projects and use them across the entire project. Like all the logging functionality is put in some classes and these classes are include in an class library project which can be called "Logging module". Whenever you need logging in any of the project you can include this module and use the functionality.
Some examples:
Web module for HTTP requests ( The WebApp)
Repository and Data access Layer modules. (DAL code)
Models module containing all the business entities.
WebService modules for integrating with other apps.
Logging for debugging and problem identification
Infrastructure/Utility modules for utility like functionalities and
application configuration.
Business logic modules.
Transaction gateway module.
Other way to define module in .net is they are PE files and I believe they have extension .netmodule which contain Metadata but they do not contain the assembly manifest. To use a module you have to create a PE file with the necessary assembly manifest.
Create a module:
csc /t:module ufo.cs
Create assembly using the module:
csc /t:library /addmodule:ufo.netmodule /out:airvehicles.dll helicopter.cs
Above 2 commands are from this link
The module is an external code that you plugin on your site and runs in order to do some actions.
(source: codeguru.com)
We make and use modules to have the ability to share the actions of the module with others with out giving the source code, and vice versa, we use modules from other that we do not have access to the source code. Or we can simple use module for have the ability so simplify our code and remove it easy if we do not need it.
We can have as modules as we like, but each module place extra overhead on our code - after all is need to make more thinks there.
More about modules: http://www.codeguru.com/csharp/.net/net_asp/article.php/c19389/HTTP-Handlers-and-HTTP-Modules-in-ASPNET.htm
How to create module: http://support.microsoft.com/kb/307996
As you know, we could build a RIA application based on flex. Also, we could build an desktop application based on AIR. I have a question, If we want to build web & desktop application simultaneously. Could we use the same codes to ship our production to web & desktop?
If you design your application for it, you should have no problems in sharing 99% of your codebase between your Flex and AIR builds.
You will need a separate application MXML for the Flex / AIR versions as AIR uses a WindowedApplication and Flex uses Application
You will need to abstract your usage of any AIR-only APIs. That is, any class, property or method marked with the AIR-only icon (
) in the Online Documentation. You might find this process easier if you are using a Dependency Injection container like Swift Suspenders.
Alternatively, you can split your service definitions into two different source trees. This would result in your AIR project and Flex project sharing one source path, but also having their own source path. This way, code that accesses com.application.MyService would be shared across AIR and Flex but the implementation of com.application.MyService would differ depending on which 'service source path' was being used.
You may find it useful to configure each build with a compiler flag like -define+=CONFIG::AIR. This allows you to use conditional compilation so that you can compile the same file for both builds, but include specific code for the AIR build.
Here is an exmaple of conditional compilation:
public function getMyService() : IMyService
{
CONIFG::AIR
{
return new MyServiceThatUsesAnAIROnlyAPI();
}
return new FallbackServiceForFlex();
}
Unfortunately there is no way to 'negate' a conditional flag (ie. !CONFIG::AIR) so you either need to be smart about your usage of it, or include two flags (CONFIG::AIR and CONFIG::FLEX)
I'm surprised no one said it yet, but this is how I would do it:
Create a library project. this project will include all your
shared code.
Create a Flex project for web deployment
Create an AIR Project for AIR deployment
Both the Flex and AIR projects can reference and use code in the library project. The AIR project can use AIR specific functionality without affecting the web project.
If you need to perform different actions differently based on whether using the web project or the AIR project, you can create interfaces in the library project and implement them in the main project to use the respective APIs.
yes, you can do it.
there are some conditions you have to control in code.
Keep in mind, if the application is also a flex app, then it will be a single window app.
for every project I make needing this I create 3 projects
code base (the main control is a group or a canvas)
flex exporter => when you build this you will end up with a flex application
it has a control from #1 inside the main application
air exporter => when you build this you will end up with an Air app
it has a control from #1 inside the main window.