Linddotnetcore~ Framework Introduction and features (a bit of springboot meaning)

Source: Internet
Author: User
Tags assert solr

Linddotnetcore Module Introduction
Uncle Blog

Linddotnetcore Related Module Introduction
  • [x] Global is dependent on di
  • [x] Message Queuing
  • [x] NoSql
  • [x] Caching
  • [x] Warehousing
  • [X] Service Bus
  • [x] Solr
  • [X] Dispatch
  • [x] Log
  • [x] Asspect Intercept component
  • [] UAA Authorization
  • [] Construction of various component environments
  • [x] Each module unit test writing

    Di United Front

    The Linddotnet framework also uses a global DI injection to use module objects, a loosely coupled design for unit testing
    is very convenient for people.

    services.AddLog4Logger(o =>{o.Log4ConfigFileName = "log4.config";o.ProjectName = "test";});services.UseDapper(o =>{o.ConnString = $"Data Source=/Data/intergratetest.db";o.DbType = Lind.DotNetCore.Repository.DbType.SqlLite;});
    Message Queuing

    Message Queuing is primarily implemented with ' Rabbitmq,kafka ' to decouple projects, handle high concurrency tasks and time-consuming tasks, and producers
    There is no need to care who wants to consume, it sends the message to the queue, and the consumer does not care about how the message is generated, just the consumption by
    Business logic to get rid of it!

    services.AddRabbitMQ(o =>{o.ExchangeName = "Piliapa.zzl";o.MqServerHost = "192.168.200.214";o.VirtualHost = "/";o.ExchangeType = "topic";});
    Nosql

    The current structure of the NoSQL part consists of redis和mongodb all the choices of the two frameworks the biggest reason is that they cover the
    All NoSQL usage scenarios, like Redis used to store k/v key-value pairs, support 5 large data structures, and MongoDB is used to store documents
    Data, support complex queries, nested queries, and more.

    services.AddRedis(o =>{o.Host = "localhost:6379";o.AuthPassword = "";o.IsSentinel = 1;o.ServiceName = "mymaster";o.Proxy = 0;});
    Caching

    Data caching is an important part to store some hot data, and the current distributed environment uses Redis, which can be used directly
    Run-time caching.

    services.AddRuntimeCache(o =>{o.CacheKey = "lindCache";o.ExpireMinutes = 5;});
    Warehousing

    Warehousing mainly simplifies the operation of data persistence, provide a simple curd interface, the user can directly call, do not need to intervene in SQL statements,
    In this regard, the efficiency of development has indeed improved a lot. At present the Uncle Frame integrates ef,dapper,mongodb,redis,elastic such warehousing, which
    EF and dapper can manipulate databases such as Sqlserver,mysql,sqllite.

    services.UseDapper(o =>{o.ConnString = $"Data Source={Directory.GetCurrentDirectory()}/intergratetest.db";o.DbType = Lind.DotNetCore.Repository.DbType.SqlLite;});
    Service Bus

    Service bus is primarily used to decouple the calls between layers of the project and the programmer to put the focus on the business, the current framework provides an IOC-mode event,
    Events that are stored based on simple memory dictionaries.

    services.AddIocBus();services.AddInMemoryBus();
    Solr

    SOLR was Lucene developed prior to the foundation, written in Java, typically deployed on Tomcat, with its own image management interface that can be used to manage the core,
    In general, when designing a core, we need to create a corresponding entity for it, corresponding to its attributes in the core; SOLR has a rich set of plugins, like some
    Chinese word breaker, index package, etc.

    services.AddSolrNet(o =>{o.ServerUrl = "http://192.168.200.214:8081/solr/system_companysubject";o.UserName = "sa";o.Password = "sa";});
    Dispatch Service

    The dispatch service is based on the quartz core and encapsulates its functionality to support the task of adding in real time, which uses the Windows/linux directory monitoring event
    , also. Netcore help us achieve, we just need to subscribe to relevant events.

    var watcher = new FileSystemWatcher{Path = AppDomain.CurrentDomain.BaseDirectory,NotifyFilter = NotifyFilters.Attributes |               NotifyFilters.CreationTime |               NotifyFilters.DirectoryName |               NotifyFilters.FileName |               NotifyFilters.LastAccess |               NotifyFilters.LastWrite |               NotifyFilters.Security |               NotifyFilters.Size,Filter = "*.dll"};// quartz运行时,可以添加新job,但不能覆盖,删除等watcher.Created += new FileSystemEventHandler((o, e) =>{foreach (var module in Assembly.LoadFile(e.FullPath).GetModules()){    foreach (var type in module.GetTypes().Where(i => typeof(ISchedulingJob).IsAssignableFrom(i)))    {        JoinToQuartz(type, DateTimeOffset.Now);    }}});//Start monitoring.watcher.EnableRaisingEvents = true;
    Log

    The log frame differs from the previous Lind framework in that it only moves the object's life cycle to the DI container for unified management, using a single-case approach, and the current log framework provides
    Support for log4net, while lightweight logs can be implemented using Lindlogger.

    services.AddLog4Logger(o =>{o.Log4ConfigFileName = "log4.config";o.ProjectName = "test";});
    Asspect Intercept Components

    Method interception is widely used in Microsoft framework, it mvc,api can dynamically add all logic before and after the execution of the method, without paying attention to the details of the method and implementing the interception behavior.
    Developers do not need to focus on the details of the method, which takes advantage of the object-oriented encapsulation feature, but also conforms to the open and closed principle, because you can not modify the original code in the case of dynamic
    Add behavior to it.

    [Fact]public void FuncInvoke(){var obj = ProxyFactory.CreateProxy<AspectTest, AspectTest>();Assert.Equal("OK", obj.GetHello());}[Fact]public void ActionInvoke(){var obj = ProxyFactory.CreateProxy<AspectTest, AspectTest>();obj.SetHello();Assert.Equal(1, 1);}

    Cond...
    Back to Catalog

Linddotnetcore~ Framework Introduction and features (a bit of springboot meaning)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.