14 Latest and Best 404 Error Page Designs for Webs/Mobile Apps β¨
A 404 error page, which often serves to alert web/app visitors that the page they are trying to reach does not exist, is often regarded as one of the most possible elements to lose users/visitors with boring and dull logging-in/out/loading/leading pages in a web/app. π
However, that does not mean such error pages will be a nightmare in all cases. β
Actually, a creative, cool, interesting or informative 404 error page can not only lead customers to other parts of your websites/apps smoothly, but also reduce customer frustration and let them stay on the site/app much longer. π
Letβs keep reading this article and enjoy 14 latest and best 404 error page designs to get inspiration and learn how to make a beautiful, interesting and attractive 404 error not found page design. β‘οΈ
https://t.me/pgimg/111
[ Article ] : https://goo.gl/A5mJjx
γ°γ°γ°γ°γ°γ°
#Design #UI #UX
@ProgrammingTip
A 404 error page, which often serves to alert web/app visitors that the page they are trying to reach does not exist, is often regarded as one of the most possible elements to lose users/visitors with boring and dull logging-in/out/loading/leading pages in a web/app. π
However, that does not mean such error pages will be a nightmare in all cases. β
Actually, a creative, cool, interesting or informative 404 error page can not only lead customers to other parts of your websites/apps smoothly, but also reduce customer frustration and let them stay on the site/app much longer. π
Letβs keep reading this article and enjoy 14 latest and best 404 error page designs to get inspiration and learn how to make a beautiful, interesting and attractive 404 error not found page design. β‘οΈ
https://t.me/pgimg/111
[ Article ] : https://goo.gl/A5mJjx
γ°γ°γ°γ°γ°γ°
#Design #UI #UX
@ProgrammingTip
Telegram
Programming Tips Resources
ASP.NET Core 2 β Global Model Validation β οΈ
We use a lot of repetitive code in our actions. β»οΈ
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVCβs base controller class :
The bad thing about is that we repeat this piece of code throughout a lot of our actions. β
How we can make it betterβ
This article shows you how to validate ModelState with a global filter. π
https://t.me/pgimg/112
[ Article ] : bit.do/mval
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Validation
@ProgrammingTip
We use a lot of repetitive code in our actions. β»οΈ
Inside of our controller actions we usually check if the model is valid by using ModelState property available on MVCβs base controller class :
if (!ModelState.IsValid)
return BadRequest(ModelState);
The bad thing about is that we repeat this piece of code throughout a lot of our actions. β
How we can make it betterβ
This article shows you how to validate ModelState with a global filter. π
https://t.me/pgimg/112
[ Article ] : bit.do/mval
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #Validation
@ProgrammingTip
Telegram
Programming Tips Resources
Controller Lookup & Default Controller Factory π
As the name, the Controller factory is the component responsible for searching and creating controllers.π·
Like many other components, ASP.NET MVC has a built-in factory named DefaultControllerFactory that's pretty much sufficient in most cases. π
Searching a controller is a perform intensive job and the DefaultControllerFactory does some efficient caching mechanism to avoid looking for controllers every time when there is a need. β
In this article we are going to explore how the DefaultControllerFactory searches for a controller and what kind of strategies it uses to do the process efficiently. β‘οΈ
https://t.me/pgimg/113
[ Article ] : bit.do/cfac
γ°γ°γ°γ°γ°γ°
#AspMvc #Controller #Depth
@ProgrammingTip
As the name, the Controller factory is the component responsible for searching and creating controllers.π·
Like many other components, ASP.NET MVC has a built-in factory named DefaultControllerFactory that's pretty much sufficient in most cases. π
Searching a controller is a perform intensive job and the DefaultControllerFactory does some efficient caching mechanism to avoid looking for controllers every time when there is a need. β
In this article we are going to explore how the DefaultControllerFactory searches for a controller and what kind of strategies it uses to do the process efficiently. β‘οΈ
https://t.me/pgimg/113
[ Article ] : bit.do/cfac
γ°γ°γ°γ°γ°γ°
#AspMvc #Controller #Depth
@ProgrammingTip
Telegram
Programming Tips Resources
Render Action & Render Partial.png
1 MB
Nancy wants to display the logged-in users in a partial view. π€
She got confused whether to use RenderAction or RenderPartial.π§
Mark clarifies her when to use what. β
γ°γ°γ°γ°γ°
#AspMvc
@ProgrammingTip
She got confused whether to use RenderAction or RenderPartial.π§
Mark clarifies her when to use what. β
γ°γ°γ°γ°γ°
#AspMvc
@ProgrammingTip
Principle of Least Surprise π³
Principle Statement :
In interface design, always do the least surprising thing. π¨
Description :
Never surprise the user. β
An interface should behave exactly as the user thinks it behaves. β
What surprises the user depends on the kind of interface and the type of user. π₯
The central idea of PLS is to think about how the user would want to use the interface. π€³π»
Principle of least astonishment is when you, as an API designer, prevent your users from saying WAT. π±
πΈπΉπΈπΉ
Examples :
1οΈβ£ Consider an elevator with a button next to it that says "call". βοΈ
When you press the button, the payphone phone rings (rather than calling the elevator to that floor). β
The correct design would be to put the call button next to the phone rather than the elevator. β
2οΈβ£ Think of a web page that has popup window that shows a windows style error with an 'ok' button on it. π
People click the 'ok' button thinking it is for the operating system and instead go to another web page. π
This astonishes the user. π¦
3οΈβ£ The name of a function should reflect what it does. Otherwise, a user of the function will be unpleasantly surprisedβοΈ
Bad :
Better :
πΉπΈπΉπΈ
When it comes to an API ... πΎ
β’ Think about a toString() method that instead of printing out the fields returns back "to be implemented". π€₯
β’ An equals() method that works on hidden information. π
β’ Sometimes people try to implement a sorted list class by changing the add method to call sort() on the array afterwards. π
This astonishing because the add method is supposed to append to the list. π³
This is especially astonishing when one gets back a List object with no knowledge that somewhere deep inside, someone violated the interface contract. π€
Having a method that does one distinct thing contributes to reduction of astonishment. β
https://t.me/pgimg/115
γ°γ°γ°γ°γ°γ°
#Principle #PLS
@ProgrammingTip
Principle Statement :
In interface design, always do the least surprising thing. π¨
Description :
Never surprise the user. β
An interface should behave exactly as the user thinks it behaves. β
What surprises the user depends on the kind of interface and the type of user. π₯
The central idea of PLS is to think about how the user would want to use the interface. π€³π»
Principle of least astonishment is when you, as an API designer, prevent your users from saying WAT. π±
πΈπΉπΈπΉ
Examples :
1οΈβ£ Consider an elevator with a button next to it that says "call". βοΈ
When you press the button, the payphone phone rings (rather than calling the elevator to that floor). β
The correct design would be to put the call button next to the phone rather than the elevator. β
2οΈβ£ Think of a web page that has popup window that shows a windows style error with an 'ok' button on it. π
People click the 'ok' button thinking it is for the operating system and instead go to another web page. π
This astonishes the user. π¦
3οΈβ£ The name of a function should reflect what it does. Otherwise, a user of the function will be unpleasantly surprisedβοΈ
Bad :
int multiply(int a, int b)
{
return a + b;
}
Better :
int multiply(int a, int b)
{
return a * b;
}
πΉπΈπΉπΈ
When it comes to an API ... πΎ
β’ Think about a toString() method that instead of printing out the fields returns back "to be implemented". π€₯
β’ An equals() method that works on hidden information. π
β’ Sometimes people try to implement a sorted list class by changing the add method to call sort() on the array afterwards. π
This astonishing because the add method is supposed to append to the list. π³
This is especially astonishing when one gets back a List object with no knowledge that somewhere deep inside, someone violated the interface contract. π€
Having a method that does one distinct thing contributes to reduction of astonishment. β
https://t.me/pgimg/115
γ°γ°γ°γ°γ°γ°
#Principle #PLS
@ProgrammingTip
Telegram
Programming Tips Resources
Nivo β¨
Provides supercharged React components to easily build dataviz apps, it's built on top of d3. βοΈ
Several libraries already exist for React d3 integration, but just a few provide server side rendering ability and fully declarative charts. π
Features :
πΈ Highly customizable
πΉ Motion/transitions
πΈ Component playground
πΉ Exhaustive documentation
πΈ Isomorphic rendering
πΉ SVG charts
πΈ HTML charts
πΉ Canvas charts
πΈ Server side rendering API
πΉ Gradients
πΈ Responsive charts
https://t.me/pgimg/116
[ Source ] : github.com/plouc/nivo
[ Document & Website ] : nivo.rocks
γ°γ°γ°γ°γ°γ°
#React #Chart #Calendar
#Treemap #JavaScript
@ProgrammingTip
Provides supercharged React components to easily build dataviz apps, it's built on top of d3. βοΈ
Several libraries already exist for React d3 integration, but just a few provide server side rendering ability and fully declarative charts. π
Features :
πΈ Highly customizable
πΉ Motion/transitions
πΈ Component playground
πΉ Exhaustive documentation
πΈ Isomorphic rendering
πΉ SVG charts
πΈ HTML charts
πΉ Canvas charts
πΈ Server side rendering API
πΉ Gradients
πΈ Responsive charts
https://t.me/pgimg/116
[ Source ] : github.com/plouc/nivo
[ Document & Website ] : nivo.rocks
γ°γ°γ°γ°γ°γ°
#React #Chart #Calendar
#Treemap #JavaScript
@ProgrammingTip
Telegram
Programming Tips Resources
Use DbContextPooling to Improve the Performance : .NET Core 2.1 Feature π
If you are familiar with .NET Core, then you might be knowing AddDbContext method. π§
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. π
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. β»οΈ
New contexts are getting created for each request. β³
That is still fine but if there are more than 1k requests β 1k times object will be created and disposed, unless you have made it a Singleton. βπ»
Creating and disposing of so many objects may impact the performance. β
How DbContextPooling can helpβ
https://t.me/pgimg/117
[ Article ] : http://bit.do/dbpol
γ°γ°γ°γ°γ°γ°
#AspMvc #Core
@ProgrammingTip
If you are familiar with .NET Core, then you might be knowing AddDbContext method. π§
This method is used to inject dependency of DbContext into your controller and it should be written in the Startup.cs class. π
So in case of AddDbContext, a new instance will be created for each request and would get disposed once the work is done. β»οΈ
New contexts are getting created for each request. β³
That is still fine but if there are more than 1k requests β 1k times object will be created and disposed, unless you have made it a Singleton. βπ»
Creating and disposing of so many objects may impact the performance. β
How DbContextPooling can helpβ
https://t.me/pgimg/117
[ Article ] : http://bit.do/dbpol
γ°γ°γ°γ°γ°γ°
#AspMvc #Core
@ProgrammingTip
Telegram
Programming Tips Resources
Using MariaDB with ASP.NET Core 2.0 π
What is MariaDBβ
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. π§
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. π
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. β¨
So letβs put this to the test with a simple ASP.NET Core application. π₯
https://t.me/pgimg/118
[ Article ] : bit.do/mariad
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
What is MariaDBβ
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. π§
Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation. π
Basically it is a fork of MySQL which is guaranteed to stay open source, and as noted it is supposed to be a drop-in replacement for MySQL. β¨
So letβs put this to the test with a simple ASP.NET Core application. π₯
https://t.me/pgimg/118
[ Article ] : bit.do/mariad
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #MariaDB #MySql
@ProgrammingTip
Telegram
Programming Tips Resources
18 Interesting Things from jQuery β¨
jQuery is one of the most popular JavaScript libraries in use today. π
It is the library that is beloved by most of the web developers for scripting. πΎ
In this article I'm going to share you some of the interesting things from that library. π₯
https://t.me/pgimg/119
[ Article ] : bit.do/jqint
γ°γ°γ°γ°γ°γ°
#JavaScript #jQuery
@ProgrammingTip
jQuery is one of the most popular JavaScript libraries in use today. π
It is the library that is beloved by most of the web developers for scripting. πΎ
In this article I'm going to share you some of the interesting things from that library. π₯
https://t.me/pgimg/119
[ Article ] : bit.do/jqint
γ°γ°γ°γ°γ°γ°
#JavaScript #jQuery
@ProgrammingTip
Telegram
Programming Tips Resources
Blazor π₯
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. π
Blazor is a .NET web framework that runs in any browser. π
Blazor uses only the latest web standards. No plugins or transpilation needed. β
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. β‘οΈ
It works in older browsers too by falling back to an asm.js based .NET runtime. π΄πΏ
Blazor will have all the features of a modern web framework, including β¨ :
β’ Components
β’ Routing
β’ Layouts
β’ Forms and validation
β’ Dependency injection
β’ JavaScript interop
β’ Live reloading
β’ Server-side rendering
β’ Full .NET debugging
https://t.me/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
γ°γ°γ°γ°γ°γ°
#Blazor #AspMvc #Core
@ProgammingTip
An experimental .NET web framework using C#/Razor and HTML that runs in the browser via WebAssembly that is supported by Microsoft. π
Blazor is a .NET web framework that runs in any browser. π
Blazor uses only the latest web standards. No plugins or transpilation needed. β
It runs in the browser on a real .NET runtime (Mono) implemented in WebAssembly that executes normal .NET assemblies. β‘οΈ
It works in older browsers too by falling back to an asm.js based .NET runtime. π΄πΏ
Blazor will have all the features of a modern web framework, including β¨ :
β’ Components
β’ Routing
β’ Layouts
β’ Forms and validation
β’ Dependency injection
β’ JavaScript interop
β’ Live reloading
β’ Server-side rendering
β’ Full .NET debugging
https://t.me/pgimg/120
[ Github ] : bit.do/blazor
[ Learn ] : learn-blazor.com
[ Flight Finder ] : bit.do/ffinder
[ Sample CRUD ] : bit.do/bzcrud
γ°γ°γ°γ°γ°γ°
#Blazor #AspMvc #Core
@ProgammingTip
Telegram
Programming Tips Resources
Avoid Lazy Loading Entities in ASP.NET Applications π
π»ββοΈ
Lazy Loading is an Entity Framework feature that lets you worry less about the specific amount of data you need to fetch with a given query. π
Instead, you write simple queries, and Entity Framework will load the minimal amount of data (which is a good thing), and then will only fetch additional data on an as-needed basis. β
That is, rather than eager loading all of the related data a given entity might have, lazy loading is a technique that has EF perform the minimal amount of work needed up front, and then only performs additional work if it turns out to be necessary. β οΈ
This sounds like a great feature, but you should turn it off in your ASP.NET web apps. π«
This article explains why you should do this. π§
https://t.me/pgimg/121
[ Article ] : bit.do/lazyy
γ°γ°γ°γ°γ°γ°
#AspMvc #LazyLoading
@ProgrammingTip
Lazy Loading is an Entity Framework feature that lets you worry less about the specific amount of data you need to fetch with a given query. π
Instead, you write simple queries, and Entity Framework will load the minimal amount of data (which is a good thing), and then will only fetch additional data on an as-needed basis. β
That is, rather than eager loading all of the related data a given entity might have, lazy loading is a technique that has EF perform the minimal amount of work needed up front, and then only performs additional work if it turns out to be necessary. β οΈ
This sounds like a great feature, but you should turn it off in your ASP.NET web apps. π«
This article explains why you should do this. π§
https://t.me/pgimg/121
[ Article ] : bit.do/lazyy
γ°γ°γ°γ°γ°γ°
#AspMvc #LazyLoading
@ProgrammingTip
Telegram
Programming Tips Resources
Ngrok π₯
Ngrok allows you to expose a web server running on your local machine to the internet. π
Just tell ngrok what port your web server is listening on :ππ»
Result β :
You can now access your website from β¨ :
http://92832de0.ngrok.io
When you start ngrok, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel π .
Inspecting Your Traffic π
Ngrok provides a real-time web UI where you can introspect all of the HTTP traffic running over your tunnels. π
After you've started ngrok, just open http://localhost:4040 in a web browser to inspect request details. π
https://t.me/pgimg/122
[ Docs ] : ngrok.com/docs
γ°γ°γ°γ°γ°γ°
#Ngrok #Testing
@ProgrammingTip
Ngrok allows you to expose a web server running on your local machine to the internet. π
Just tell ngrok what port your web server is listening on :ππ»
ngrok http [port] -host-header="localhost:[port]"
Result β :
Tunnel Status : online
Version : 2.0/2.0
Web Interface : 127.0.0.1:4040
Forwarding : http://92832de0.ngrok.io
Forwarding : https://92832de0.ngrok.io
You can now access your website from β¨ :
http://92832de0.ngrok.io
When you start ngrok, it will display a UI in your terminal with the public URL of your tunnel and other status and metrics information about connections made over your tunnel π .
Inspecting Your Traffic π
Ngrok provides a real-time web UI where you can introspect all of the HTTP traffic running over your tunnels. π
After you've started ngrok, just open http://localhost:4040 in a web browser to inspect request details. π
https://t.me/pgimg/122
[ Docs ] : ngrok.com/docs
γ°γ°γ°γ°γ°γ°
#Ngrok #Testing
@ProgrammingTip
Telegram
Programming Tips Resources
A shorter and URL friendly GUID β¨
This a small helper class in C#. πΎ
The class encodes a GUID into a 22 character long string and decodes the string back to the original GUID again. β
It takes a standard GUID like this π¬ :
And converts it into this smaller string π :
It basically just converts a GUID into a base64 string and shortens it a bit. β‘οΈ
https://t.me/pgimg/123
[ Article ] : bit.do/guids
γ°γ°γ°γ°γ°γ°
#CSharp #GUID
@ProgrammingTip
This a small helper class in C#. πΎ
The class encodes a GUID into a 22 character long string and decodes the string back to the original GUID again. β
It takes a standard GUID like this π¬ :
c9a646d3-9c61-4cb7-bfcd-ee2522c8f633
And converts it into this smaller string π :
00amyWGct0y_ze4lIsj2Mw
It basically just converts a GUID into a base64 string and shortens it a bit. β‘οΈ
https://t.me/pgimg/123
[ Article ] : bit.do/guids
γ°γ°γ°γ°γ°γ°
#CSharp #GUID
@ProgrammingTip
Telegram
Programming Tips Resources
Programming Tips π‘
Photo
ASP.NET Core.2 & Angular 5.pdf
7.3 MB
API Feature Folders β‘οΈ
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. π
You donβt need to inherit from a different base type or anything like that. β
Whatβs more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. βοΈ
What Iβve found to be a better organization is to do away with the Controllers folder (or keep it around if youβre using view-based controllers) and instead use feature folders for your APIs. π
Iβm partial to having a root level API folder but if youβd prefer to put your features in the root of the project that would work, too. ππ»
Within each feature folder, you include the controller along with any model types it needs to work with, like this πΎ :
https://t.me/pgimg/124
Obviously one benefit of this approach is that itβs more cohesive. β
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. βοΈ
Another nice thing about this approach is that it just works. Unlike view-based controllers, you donβt need to change anything about how ASP.NET Core is configured to have this organization structure work for you. β¨
[ Article ] : bit.do/apif
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #API
@ProgrammingTip
In ASP.NET Core (and unlike ASP.NET 5 / Web API 2), Web API controllers are just controllers. π
You donβt need to inherit from a different base type or anything like that. β
Whatβs more, your API controllers should be returning DTOs that are separate from your underlying domain or data model. βοΈ
What Iβve found to be a better organization is to do away with the Controllers folder (or keep it around if youβre using view-based controllers) and instead use feature folders for your APIs. π
Iβm partial to having a root level API folder but if youβd prefer to put your features in the root of the project that would work, too. ππ»
Within each feature folder, you include the controller along with any model types it needs to work with, like this πΎ :
https://t.me/pgimg/124
Obviously one benefit of this approach is that itβs more cohesive. β
Things that change together are located physically next to one another, and the friction involved in moving between different folders with too many files in them is greatly reduced. βοΈ
Another nice thing about this approach is that it just works. Unlike view-based controllers, you donβt need to change anything about how ASP.NET Core is configured to have this organization structure work for you. β¨
[ Article ] : bit.do/apif
γ°γ°γ°γ°γ°γ°
#AspMvc #Core #API
@ProgrammingTip
Telegram
Programming Tips Resources
A Mini-Course on React Native Flexbox β¨
Flexbox solves design issues that are particularly challenging on mobile, and it does so strikingly well β without requiring hacky CSS or Javascript tricks. π
But thereβs a learning curve.
The property names all sound incredibly similar and do nothing to indicate what sets them apart. βοΈ
On top of that, each property has a set of values that are mostly similar, yet slightly different, from each other. And to compound the confusion, not all properties of the Flexbox standard are included in React Native. π
This can cause surprises when you try to follow regular CSS documentation, only to discover that React Native doesnβt implement a particular feature, such as reverse flexβοΈ
To help make it easier to internalize the rules of Flexbox, Iβve decided to write the guide that I would have liked to read β with the underlying concepts explained and simple examples along the way. πΎ
Doodle along with me and get comfortable solving design scenarios with Flexbox. π
https://t.me/pgimg/125
[ Article ] : bit.do/rnat
γ°γ°γ°γ°γ°γ°
#ReactNative #Design
@ProgrammingTip
Flexbox solves design issues that are particularly challenging on mobile, and it does so strikingly well β without requiring hacky CSS or Javascript tricks. π
But thereβs a learning curve.
The property names all sound incredibly similar and do nothing to indicate what sets them apart. βοΈ
On top of that, each property has a set of values that are mostly similar, yet slightly different, from each other. And to compound the confusion, not all properties of the Flexbox standard are included in React Native. π
This can cause surprises when you try to follow regular CSS documentation, only to discover that React Native doesnβt implement a particular feature, such as reverse flexβοΈ
To help make it easier to internalize the rules of Flexbox, Iβve decided to write the guide that I would have liked to read β with the underlying concepts explained and simple examples along the way. πΎ
Doodle along with me and get comfortable solving design scenarios with Flexbox. π
https://t.me/pgimg/125
[ Article ] : bit.do/rnat
γ°γ°γ°γ°γ°γ°
#ReactNative #Design
@ProgrammingTip
Telegram
Programming Tips Resources
InversifyJS β‘οΈ
A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript. π
About π€
InversifyJS is a lightweight (4KB) inversion of control (IoC) container for TypeScript and JavaScript apps. π
An IoC container uses a class constructor to identify and inject its dependencies. π
InversifyJS has a friendly API and encourages the usage of the best OOP and IoC practices. β
Motivation π
JavaScript now supports object oriented (OO) programming with class based inheritance. These features are great but the truth is that they are also dangerous. β οΈ
We need a good OO design (SOLID, Composite Reuse, etc.) to protect ourselves from these threats. The problem is that OO design is difficult and that is exactly why we created InversifyJS. β¨
InversifyJS is a tool that helps JavaScript developers write code with good OO design. π―
Philosophy π
InversifyJS has been developed with 4 main goals π :
β’ Allow JavaScript developers to write code that adheres to the SOLID principles. βπ»
β’ Facilitate and encourage the adherence to the best OOP and IoC practices. π₯
β’ Add as little runtime overhead as possible. β°
β’ Provide a state of the art development experience. π
https://t.me/pgimg/126
[ Github ] : bit.do/inversify
γ°γ°γ°γ°γ°γ°
#JavaScript #DI #Inversify
@ProgrammingTip
A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript. π
About π€
InversifyJS is a lightweight (4KB) inversion of control (IoC) container for TypeScript and JavaScript apps. π
An IoC container uses a class constructor to identify and inject its dependencies. π
InversifyJS has a friendly API and encourages the usage of the best OOP and IoC practices. β
Motivation π
JavaScript now supports object oriented (OO) programming with class based inheritance. These features are great but the truth is that they are also dangerous. β οΈ
We need a good OO design (SOLID, Composite Reuse, etc.) to protect ourselves from these threats. The problem is that OO design is difficult and that is exactly why we created InversifyJS. β¨
InversifyJS is a tool that helps JavaScript developers write code with good OO design. π―
Philosophy π
InversifyJS has been developed with 4 main goals π :
β’ Allow JavaScript developers to write code that adheres to the SOLID principles. βπ»
β’ Facilitate and encourage the adherence to the best OOP and IoC practices. π₯
β’ Add as little runtime overhead as possible. β°
β’ Provide a state of the art development experience. π
https://t.me/pgimg/126
[ Github ] : bit.do/inversify
γ°γ°γ°γ°γ°γ°
#JavaScript #DI #Inversify
@ProgrammingTip
Telegram
Programming Tips Resources
Favor Privileges over Role Checks βοΈ
A very common practice in web applications, especially those written using the ASP.NET built-in Role provider, is to perform role checks throughout the code to determine whether a user should have access to a particular page or control or command. π
For instance, you might see something like this β»οΈ :
The problems with the maintainability of this approach become apparent after a short while.βοΈ
For one, any buttons or other controls on the SomeSpecialControl above that post back to the page should also do a role check to ensure the user submitting the postback is in an acceptable role, otherwise a security hole may be present and users outside of these roles may be able to perform privileged actions. β οΈ
πΈπΉπΈπΉ
Introducing Privileges β
Wouldn't it be better to act like thisβ
This is very clear and is at the appropriate level of abstraction. π
CanEdit isnβt itself a privilege; we can look at it as a sort of helper method in this case that lets us write clear and concise code. β¨
https://t.me/pgimg/127
[ Full Article ] : bit.do/prauth
γ°γ°γ°γ°γ°γ°
#AspMvc #Authorization
@ProgrammingTip
A very common practice in web applications, especially those written using the ASP.NET built-in Role provider, is to perform role checks throughout the code to determine whether a user should have access to a particular page or control or command. π
For instance, you might see something like this β»οΈ :
if (User.IsInRole(Roles.Administrators))
{
SomeSpecialControl.Visible = true;
}
The problems with the maintainability of this approach become apparent after a short while.βοΈ
For one, any buttons or other controls on the SomeSpecialControl above that post back to the page should also do a role check to ensure the user submitting the postback is in an acceptable role, otherwise a security hole may be present and users outside of these roles may be able to perform privileged actions. β οΈ
πΈπΉπΈπΉ
Introducing Privileges β
Wouldn't it be better to act like thisβ
EditorPanel.Visibility = CurrentUser.CanEdit(CurrentArticle);
This is very clear and is at the appropriate level of abstraction. π
CanEdit isnβt itself a privilege; we can look at it as a sort of helper method in this case that lets us write clear and concise code. β¨
https://t.me/pgimg/127
[ Full Article ] : bit.do/prauth
γ°γ°γ°γ°γ°γ°
#AspMvc #Authorization
@ProgrammingTip
Telegram
Programming Tips Resources
Real World - Conduit π
While most "todo" demos provide an excellent cursory glance at a framework's capabilities, they typically don't convey the knowledge & perspective required to actually build real applications with it. β
Real World solves this by allowing you to choose any front-end like π :
β’ React / Redux / Mobx
β’ Angular
β’ Vue
β’ Elm
β’ Aurelia
β’ Clojure
And any back-end like π :
β’ ASP.NET Core
β’ Node / Express
β’ F#
β’ Laravel
β’ Django
β’ Rails
β’ Go + Gin
β’ Rust
β’ Scala & Play Framework
β’ Hapi.js
And see how they power a real world, beautifully designed fullstack app called "Conduit". β¨
https://t.me/pgimg/128
[ Projects ] : bit.do/reworld
γ°γ°γ°γ°γ°γ°
#Template #RealWorld
@ProgrammingTip
"The mother of all demo apps." π₯
While most "todo" demos provide an excellent cursory glance at a framework's capabilities, they typically don't convey the knowledge & perspective required to actually build real applications with it. β
Real World solves this by allowing you to choose any front-end like π :
β’ React / Redux / Mobx
β’ Angular
β’ Vue
β’ Elm
β’ Aurelia
β’ Clojure
And any back-end like π :
β’ ASP.NET Core
β’ Node / Express
β’ F#
β’ Laravel
β’ Django
β’ Rails
β’ Go + Gin
β’ Rust
β’ Scala & Play Framework
β’ Hapi.js
And see how they power a real world, beautifully designed fullstack app called "Conduit". β¨
https://t.me/pgimg/128
[ Projects ] : bit.do/reworld
γ°γ°γ°γ°γ°γ°
#Template #RealWorld
@ProgrammingTip
Telegram
Programming Tips Resources