اشتراک‌ها
مدل Actor با استفاده از Akka.net

In the same time when first object-oriented languages were emerging, another concept inspired by general relativity and quantum mechanics was taking shape – actor model. In general terms, the Actor model was defined 1973. and was developed on a platform of multiple independent processors in a network. Similar to the object-oriented approach, this essentially mathematical model, revolved around the concept of actors. An actor is the smallest structural unit of Actor model, and just like objects, they encapsulate data and behavior. In difference to objects, however, actors communicate with each other exclusively trough messages. Messages in actors are processed in a serial manner. According to the full definition of actors, they can do three things:

  • send a finite number of messages to other actors
  • create a finite number of new actors
  • designate the behavior to be used for the next message it receives 
مدل Actor با استفاده از Akka.net
اشتراک‌ها
بهینه سازی ضروری تصاویر

We should all be automating our image compression.
In 2017, image optimization should be automated. It’s easy to forget, best practices change, and content that doesn’t go through a build pipeline can easily slip. To automate: Use imagemin or libvips for your build process. Many alternatives exist.
Most CDNs (e.g. Akamai) and third-party solutions like Cloudinary, imgix, Fastly’s Image Optimizer, Instart Logic’s SmartVision or ImageOptim API offer comprehensive automated image optimization solutions.
 

بهینه سازی ضروری تصاویر
اشتراک‌ها
Primery Key از نوع GUID بجای نوع int جدول دیتابیس در مواقع وجود چندین دیتابیس
With the increasing use of Object-Relational Mapping (ORM) frameworks such as NHibernate and the ADO.NET Entity Framework, relying on the server to generate key values adds a lot of complication that most people would prefer to avoid 
Primery Key از نوع GUID بجای نوع int جدول دیتابیس در مواقع وجود چندین دیتابیس
مطالب
ارتقاء به NHibernate 3.2

شروع به کار با NH به دو قسمت تقسیم می‌شود. یک قسمت نگاشت کلا‌س‌ها است و قسمت دوم سشن گردانی آن. قسمت دوم آن به همان مباحث کلاس‌های singleton ایی که بحث آن‌ها در سایت هست بر می‌گردد. یا حتی استفاده از کتابخانه‌های IOC برای مدیریت آن (که این پیاده سازی را به صورت توکار هم دارند).
قسمت نگاشت کلاس‌ها در NH انواع و اقسامی دارد:
  • ابتدا همان فایل‌های XML مدل Hibernate جاوا بود.
  • بعد شد مدل annotation ایی به نام Castle ActiveRecord. (این پروژه آنچنان فعال نیست و علتش به این بر می‌گردد که نویسنده اصلی جذب مایکروسافت شده)
  • سپس Fluent NHibernate پدید آمد. (این پروژه هم پس از NH 3.2 ، سرد شده و به نظر آنچنان فعال نیست)
  • الان هم مدل جدیدی به صورت توکار و بدون نیاز به کتابخانه‌های جانبی از NH 3.2 به بعد به آن اضافه شده به نام mapping-by-code .
بنابراین روش مرجح از NH 3,2 به بعد، همین روش mapping-by-code توکار آن است. خصوصا اینکه نیاز به وابستگی خارجی ندارد. برای مثال به دلیل عدم فعال بودن پروژه‌هایی که نام برده شد، مثلا NH 3,3 امروز ارائه می‌شود، شاید دو ماه بعد، این کتابخانه‌های جانبی ساده سازی نگاشت‌ها، به روز شوند یا نشوند.

و ... خبر خوب اینکه شخصی در 18 قسمت به توضیح این قابلیت جدید mapping by code پرداخته و روش‌های نگاشت مرتبط رو با مثال توضیح داده که در آدرس زیر می‌تونید اون‌ها رو پیدا کنید:



اشتراک‌ها
سری 8 قسمتی NET MAUI. برای تازه‌کارها

.NET MAUI for Beginners
8 videos
.NET Multi-platform App UI (.NET MAUI) is a framework for building modern, multi-platform, natively compiled iOS, Android, macOS, and Windows apps using C# and XAML in a single codebase. In this video series you will learn how to get started with .NET MAUI, C#, and Visual Studio to build your very first cross-platform desktop and mobile app. 

سری 8 قسمتی NET MAUI. برای تازه‌کارها
اشتراک‌ها
سازمان پروژه‌های پژوهشی پیشرفتهٔ دفاعی (DARPA): تمام کدهای C باید به Rust تبدیل شوند!

DARPA Wants All C Converted To Rust

After more than two decades of grappling with memory safety issues in C and C++, the software engineering community has reached a consensus. It’s not enough to rely on bug-finding tools. The preferred approach is to use “safe” programming languages that can reject unsafe programs at compile time, thereby preventing the emergence of memory safety issues.

سازمان پروژه‌های پژوهشی پیشرفتهٔ دفاعی (DARPA): تمام کدهای C باید به Rust تبدیل شوند!
نظرات مطالب
واژه‌های کلیدی جدید and، or و not در C# 9.0
معادل‌های string.IsNullOrEmpty در C# 9.0 جهت اطلاع و آشنایی با Syntax جدید؛ اگر جائی آن‌ها را دیدید!
using System;

namespace CS9Features
{
    public static class ModernizingACodebase
    {
        public static void PropertyPatternToReplaceIsNullorEmpty1()
        {
            string hello = null;

            // Old approach
            if (!string.IsNullOrEmpty(hello))
            {
                Console.WriteLine($"{hello} has {hello.Length} letters.");
            }

            // New approach, with a property pattern
            if (hello is { Length: > 0 })
            {
                Console.WriteLine($"{hello} has {hello.Length} letters.");
            }
        }

        public static void PropertyPatternToReplaceIsNullorEmpty2()
        {
            // For arrays
            var greetings = new string[2];
            greetings[0] = "Hello world";
            greetings = null;

            // Old approach
            if (greetings != null && !string.IsNullOrEmpty(greetings[0]))
            {
                Console.WriteLine($"{greetings[0]} has {greetings[0].Length} letters.");
            }

            // New approach
            if (greetings?[0] is { Length: > 0 } hi)
            {
                Console.WriteLine($"{hi} has {hi.Length} letters.");
            }
        }
    }
}
برای مطالعه‌ی بیشتر