I talked about the encapsulation of several classes. This time we will talk about how to use it. In the actual process, how can we describe that we are missing the coding? For example, if we need a class to implement operations on a table, we only need to inherit from our Base class. UsingSystem; usingSystem. Collections. Generic; usingSystem
I talked about the encapsulation of several classes. This time we will talk about how to use it. In the actual process, how can we describe that we are missing the coding? For example, if we need a class to implement operations on a table, we only need to inherit from our Base class. Using System; using System. Collections. Generic; using System
I talked about several typesEncapsulationThis time, let's talk about how to use it.
In the actual process, how can we describe that we are missing the coding?
For example, we need a class to implementOperation, We only need to inherit from our Base class.
using System;using System.Collections.Generic;using System.Linq;using System.Text;using NOAS.PublicOpinionMonitor.Access.Common;using NOAS.PublicOpinionMonitor.ENTITY;namespace NOAS.PublicOpinionMonitor.Access{ public class ProxyDAL : AccessBase
{ public ProxyDAL() : base(strTableName:"t_po_monitor_proxy",ColumsName:@" [monitorid] ,[monitor_name] ,[tkwid] ,[monitor_stardate] ,[monitor_enddate] ,[monitor_datetype] ,[monitor_interval] ,[data_begindate] ,[data_enddate] ,[exec_datetime] ,[monito_days] ,[updatedate] ,[status]") { } public List
getAllMonitorProxy() { return getListByWhere(string.Empty); } }}
What I insist on is to do my own things. Therefore
Bottom LayerWhen the architecture is involved, each class can only
OperationCorresponding table. This makes our code clearer.
It is easier to use the service layer.
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace NOAS.PublicOpinionMonitor.BIZ{ public class ProxyBLL { public int addMonitorProxy(ENTITY.t_po_monitor_proxy proxyEntity) { new NOAS.PublicOpinionMonitor.Access.ProxyDAL().addEntity(proxyEntity); return proxyEntity.mproxyid; } public int updateMonitorProxy(ENTITY.t_po_monitor_proxy proxyEntity) { new NOAS.PublicOpinionMonitor.Access.ProxyDAL().updateEntity(proxyEntity); return proxyEntity.mproxyid; } }}
From here, I also like design and architecture. The architecture makes programming more beautiful. Think more, do more, and read more. Make our code clearer.
We are not coders. We are city fighters.