如何理解這個業務邏輯層

2021-07-04 06:07:24 字數 1025 閱讀 5289

/*

這是我的乙個stu表的模型。

*/public   class stumodel extends abstracttablemodel

//做乙個建構函式,用於初始化我們的資料模型

public stumodel()

// 書寫乙個:新增函式

public void  addstu(string sql)

// 因為上面有倆個建構函式比較冗餘,所以

public void init(string sql)

//資料庫操作

rowdata=new vector();

columname=new vector();

vector hang=new vector();

//定義列名,定義行資料

columname.add("pk_sdbh");

columname.add("sdbh");

columname.add("sdmc");

columname.add("lxdh");

columname.add("fzr");

try catch (classnotfoundexception e) catch (sqlexception e)

//讀取資料庫

try

} catch (exception e)

finally

catch (sqlexception e)

}finally}}

// 一下的三個函式,會被自動執行。

//得到共有多少列

public int getcolumncount()

// 得到共有多少行

public  int getrowcount // 這個函式的作用是什麼?

// 得到某行某列的資料

public object getvalueat(int arg0,int arg1)

public string getcolumname(int arg0)}}

}

實戰 業務邏輯層

負責處理系統的核心業務,負責對使用者定義的流程進行建模,負責資料訪問層和展示層的通訊,不能因為資料庫的變換而變化,也不能因為終端的變換而變化。bll 業務邏輯 業務邏輯的操作,包括業務處理,呼叫資料訪問,事務等。ibll 業務介面 業務邏輯層的方法對外暴露的介面和服務契約 wfactivitys 工...

三層業務邏輯

1.確定需求 2.根據需求確定sql 3.編寫資料訪問層類,dal 4.編寫業務層 bll 5.編寫表現層 ui 三層結構常用類庫 dal 資料訪問類 bll 業務類 ui 表現層 視窗,多窗體傳值的靜態類gloabhelper model 實體類 資料例項物件 utility 實用類 comman...

儲存過程還是業務邏輯層

1.儲存過程是基於計算密集型的業務邏輯。如果是基於操作密集型的就不要用儲存過程了 2.所有資料訪問在應用層封裝為資料訪問層,在那裡,如果sql簡單的話,直接用sql 如果sql複雜,或者資料互動多且中間資料最後不會用到,使用儲存過程 業務邏輯層 優點 功能分層明確,便於在業務邏輯層集中處理業務邏輯,...