<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anh.VuHoang</title>
    <description>The latest articles on DEV Community by Anh.VuHoang (@anhvuhoang).</description>
    <link>https://dev.to/anhvuhoang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1025161%2Ffdcac903-a72a-4dea-86b9-c9853d635fc1.png</url>
      <title>DEV Community: Anh.VuHoang</title>
      <link>https://dev.to/anhvuhoang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anhvuhoang"/>
    <language>en</language>
    <item>
      <title>How to control using interface vs abstract class in c#.</title>
      <dc:creator>Anh.VuHoang</dc:creator>
      <pubDate>Sat, 30 Mar 2024 02:00:45 +0000</pubDate>
      <link>https://dev.to/anhvuhoang/how-to-control-using-interface-vs-abstract-class-in-c-442o</link>
      <guid>https://dev.to/anhvuhoang/how-to-control-using-interface-vs-abstract-class-in-c-442o</guid>
      <description>&lt;p&gt;It is true that computers have more power than ever.SDKs are so smart to support developers quickly and effectively. But I assure that crucial knowledge of programming is important. These are building amazing frameworks or super platforms while People mix up what is an interface or an abstract class, when do, why use it.&lt;br&gt;
We are here to clearly make some mistakes. This knowledge is gained today and used to implement an application that is effective and optimized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interface&lt;/strong&gt;&lt;br&gt;
An interface is like a contract that a class must follow. The body of interfaces doesn't provide any implementation of these methods. It only defines this type of return, name's method and parameters.&lt;br&gt;
Today, some languages of programming, such as C# 10 &lt;a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/default-interface-methods"&gt;Defaults Methods&lt;/a&gt; or Java which are enable concrete implementation methods. It means these IDEs don't notice that it is invalid.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7ekgqt89jszpdp03tgu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7ekgqt89jszpdp03tgu.png" alt="Image description" width="800" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a contract, so any class or struct implement interface must provide implementation details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstract class&lt;/strong&gt;&lt;br&gt;
An abstract class as a sort of halfway house between a pure interface and a fully implemented class. It is more flexible than interfaces. We can require implementation in this derived class through abstract functions. These methods can also be overridden if the base class allows for overriding by &lt;strong&gt;virtual&lt;/strong&gt; keyword.&lt;/p&gt;

&lt;p&gt;Use abstract classes as base common functions to inherit or override. We can change this method to meet with derived classes, while no changes to base functions also impact other classes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Similarly between abstract class and interface&lt;/strong&gt; &lt;br&gt;
In fact, both interfaces and abstract classes cannot be instantiated. We may think that they are not complete. They need more implementations before they can be instantiated.&lt;br&gt;
Another key is that a class can both inherit from a abstract class and implement multiple interfaces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feenht92g72n2es56hako.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feenht92g72n2es56hako.png" alt="Image description" width="537" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Differences between Abstract class and Interface&lt;/strong&gt; &lt;br&gt;
The main difference between an interface and an abstract class is that an interface cannot have properties. It only supports fields, while an abstract class can have both fields and properties. &lt;/p&gt;

&lt;p&gt;Another key difference is that classes can implement more than one interface, but they can extend only one abstract class. Design classes implement multiple interfaces, which is the Interface Segregation Principle in SOLID. &lt;/p&gt;

&lt;p&gt;Another difference is that interfaces can be implemented by classes or extended by an interface, because an interface extending another interface is not responsible for implementing methods from the parent interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inclusion&lt;/strong&gt;&lt;br&gt;
In summary, the choice between abstraction and interfaces depends on the relationships between classes and the level of implementation detail that you want to provide. Use abstraction when there is a common implementation among related classes, and use interfaces when there is a common contract among unrelated classes.&lt;/p&gt;

&lt;p&gt;Abstraction and interfaces are both essential concepts in object-oriented programming. It is important to note that we should mix up definitions. Using it correctly will help optimize your application.&lt;/p&gt;

</description>
      <category>microsoft</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>Blazor in dotnet 8.(Static Server Side Rendering)</title>
      <dc:creator>Anh.VuHoang</dc:creator>
      <pubDate>Sun, 24 Mar 2024 09:25:01 +0000</pubDate>
      <link>https://dev.to/anhvuhoang/blazor-in-dotnet-8static-server-side-rendering-jcf</link>
      <guid>https://dev.to/anhvuhoang/blazor-in-dotnet-8static-server-side-rendering-jcf</guid>
      <description>&lt;p&gt;In this post, we discover these changes significantly in the new features of Blazor in Dotnet 8 to improve web user experiences, interactive components in DotNet Web, which are never forgotten by developers based on Blazor.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Static Server Side Rendering&lt;/strong&gt;:enhances the benefits of static server side while experiencing such a SPA.&lt;br&gt;
Static server side means content will create and render the whole DOM on the host server and send it to clients, then only present static content on DOM. This is amazing for SEO frendly, delivery content very fast, no require client resources. Obviously,it is fall, if you want to handle user-interactive events such as click events, sort data, vv. These events will be sent to the server handle and then sent back to the client. Or create a web socket(SignR) and you can communicate with users in real time and both receive events and handle them. But it is hard to scale the web application.&lt;/p&gt;

&lt;p&gt;Blazor in Dotnet 8 introduces a new hosting model called static server-side rendering. Although the procedure has the same look as Razor page or MVC app, it just takes an HTTP request type to communicate with user's browser and reply with HTTM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq69ztrkxhaklk6ezdiwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq69ztrkxhaklk6ezdiwd.png" alt="Image description" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is true that static server-side rendering is good for scale, delivering content very quickly while you still can provide smooth user experience through &lt;br&gt;
&lt;strong&gt;Auto Render Mode in .NET 8&lt;/strong&gt;.&lt;br&gt;
Though smart serve users on client or server rendering on each situation.Auto Render Mode elevates the user experience by reducing load times and improving interactive performance, making Blazor an even more enticing framework for modern web development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabx4j0d2lpipbjki3ile.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabx4j0d2lpipbjki3ile.png" alt="Image description" width="540" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Streaming Rendering.&lt;/strong&gt;&lt;br&gt;
Streaming rendering is another promising capability in DotNet 8 Blazor. Using server-side, the full HTML page is rendered by the server. Blazor has the improvement section content. Section contents that need too long times queries are streamed. The cool thing here, Page can render placeholder content while asynchronous operations are in progress. Data calling completely doesn't require other requests and seamlessly patched into the DOM.&lt;br&gt;
When using &lt;strong&gt;streaming Rendering&lt;/strong&gt; initial HTML page is still rendered on the host side.It means that it doesn't need more client resources. It’s all about improving then limited user delay experience by minimizing wait times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
These improvements for Blazor today bring many promises that we will enjoy DotNet Blazor. &lt;br&gt;
Server-side rendering, or SSR, is the new default for Blazor applications, and components use the classic approach of processing all logic on the server and producing static HTML that is sent to the client effectively.&lt;br&gt;
Streaming rendering can be thought of as an SSR+ mode. If your application has to make long running calls when constructing a page, and those calls don’t work well with caching approaches, then streaming rendering is going to be a great option.&lt;/p&gt;

&lt;p&gt;Please give a👏if you want to see more articles like this!&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>microsoft</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>The BPF(version vietnamese)</title>
      <dc:creator>Anh.VuHoang</dc:creator>
      <pubDate>Sat, 21 Oct 2023 00:02:55 +0000</pubDate>
      <link>https://dev.to/anhvuhoang/the-bpfversion-vietnamese-3phe</link>
      <guid>https://dev.to/anhvuhoang/the-bpfversion-vietnamese-3phe</guid>
      <description>&lt;p&gt;&lt;a href="https://viblo.asia/p/backend-for-frontend-bff-pattern1-MkNLrmm7JgA"&gt;https://viblo.asia/p/backend-for-frontend-bff-pattern1-MkNLrmm7JgA&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>pattern</category>
      <category>software</category>
    </item>
  </channel>
</rss>
