Design Patterns
-
In our application our atchitect created the Business classes with following structures containing Data Access Layer, Business Layer, Business Entities Layer, Presentation Layer. Business Entities Class public class PersonFormData { #region Fileds private int id; private string name; #endregion #region Properties public int ID { get { return id; } set { id = value; } } #endregion #region constructors public PersonFormData() { // // TODO: Add constructor logic here // } public PersonFormData(int pid, string pname) { id = pid; name = pname; } #endregion Business classes //This class is the Person business class public class PersonForm { #region Fields private readonly PersonFormData formDataObject; #endregion #region Constructors public PersonForm() { } public PersonForm(PersonFormData formDataObject) { this.formDataObject = formDataObject; } #endregion #region SaveForm protected override bool SaveForm() { //Calling the Data Access Layer methods PersonFormDataAcess.UpdatePersonForm(formDataObject); } #endregion // This class provides static "factory" methods that create instances of Forms Public static class FormFactory { public static PersonForm CreateEmptyPerson() { // Observe that the no-argument Chapter41ContractForm constructor creates all of the form's // related business objects. return new PersonForm(); } public static PersonForm LoadPerson() { PersonFormData formDataObject= PersonFormDataAcess.LoadPersonForm(Params); PersonForm result=new PersonForm(formdataObject); return result; } } Data Access Layer methods //This is the Data Access Layer class public static class PersonFormDataAcess { public static UpdatePersonForm(PersonFormData formDataObject) { //Calling the stored procedures here; //Accesing the business entities object fields to pass values to database. formDataObject.ID; } public static LoadPersonForm(Params) {
-
In our application our atchitect created the Business classes with following structures containing Data Access Layer, Business Layer, Business Entities Layer, Presentation Layer. Business Entities Class public class PersonFormData { #region Fileds private int id; private string name; #endregion #region Properties public int ID { get { return id; } set { id = value; } } #endregion #region constructors public PersonFormData() { // // TODO: Add constructor logic here // } public PersonFormData(int pid, string pname) { id = pid; name = pname; } #endregion Business classes //This class is the Person business class public class PersonForm { #region Fields private readonly PersonFormData formDataObject; #endregion #region Constructors public PersonForm() { } public PersonForm(PersonFormData formDataObject) { this.formDataObject = formDataObject; } #endregion #region SaveForm protected override bool SaveForm() { //Calling the Data Access Layer methods PersonFormDataAcess.UpdatePersonForm(formDataObject); } #endregion // This class provides static "factory" methods that create instances of Forms Public static class FormFactory { public static PersonForm CreateEmptyPerson() { // Observe that the no-argument Chapter41ContractForm constructor creates all of the form's // related business objects. return new PersonForm(); } public static PersonForm LoadPerson() { PersonFormData formDataObject= PersonFormDataAcess.LoadPersonForm(Params); PersonForm result=new PersonForm(formdataObject); return result; } } Data Access Layer methods //This is the Data Access Layer class public static class PersonFormDataAcess { public static UpdatePersonForm(PersonFormData formDataObject) { //Calling the stored procedures here; //Accesing the business entities object fields to pass values to database. formDataObject.ID; } public static LoadPersonForm(Params) {
The answer is just there for you to find; use your 2 eyes.
Maximilien Lincourt Your Head A Splode - Strong Bad
-
The answer is just there for you to find; use your 2 eyes.
Maximilien Lincourt Your Head A Splode - Strong Bad
I don't know any thing about patterns, So I posted the question here. If you want to help give the answer other wise why would you answer this post? IF I know what patterns he implemented then I search for those patterns to get more information. With out knowing the pattern I searched the web It gave me so much information. To learn about patterns I want to start from the pattern which I have some examples from my application.
-
I don't know any thing about patterns, So I posted the question here. If you want to help give the answer other wise why would you answer this post? IF I know what patterns he implemented then I search for those patterns to get more information. With out knowing the pattern I searched the web It gave me so much information. To learn about patterns I want to start from the pattern which I have some examples from my application.
-
In our application our atchitect created the Business classes with following structures containing Data Access Layer, Business Layer, Business Entities Layer, Presentation Layer. Business Entities Class public class PersonFormData { #region Fileds private int id; private string name; #endregion #region Properties public int ID { get { return id; } set { id = value; } } #endregion #region constructors public PersonFormData() { // // TODO: Add constructor logic here // } public PersonFormData(int pid, string pname) { id = pid; name = pname; } #endregion Business classes //This class is the Person business class public class PersonForm { #region Fields private readonly PersonFormData formDataObject; #endregion #region Constructors public PersonForm() { } public PersonForm(PersonFormData formDataObject) { this.formDataObject = formDataObject; } #endregion #region SaveForm protected override bool SaveForm() { //Calling the Data Access Layer methods PersonFormDataAcess.UpdatePersonForm(formDataObject); } #endregion // This class provides static "factory" methods that create instances of Forms Public static class FormFactory { public static PersonForm CreateEmptyPerson() { // Observe that the no-argument Chapter41ContractForm constructor creates all of the form's // related business objects. return new PersonForm(); } public static PersonForm LoadPerson() { PersonFormData formDataObject= PersonFormDataAcess.LoadPersonForm(Params); PersonForm result=new PersonForm(formdataObject); return result; } } Data Access Layer methods //This is the Data Access Layer class public static class PersonFormDataAcess { public static UpdatePersonForm(PersonFormData formDataObject) { //Calling the stored procedures here; //Accesing the business entities object fields to pass values to database. formDataObject.ID; } public static LoadPersonForm(Params) {
hi there, if you look at the last line of code you wrote, the word Factory suggests he is using software factories. Software factories is a bit vague as you can use different patterns to implement it, i,e Abstract Pattern. If you want to learn more than download the Microsoft .NET PetShop application and see how its software factories are implemented. http://msdn2.microsoft.com/en-us/library/aa479071.aspx[^] The other resource you can try is: http://www.dofactory.com/Default.aspx[^] Hope this helps.
-
I don't know any thing about patterns, So I posted the question here. If you want to help give the answer other wise why would you answer this post? IF I know what patterns he implemented then I search for those patterns to get more information. With out knowing the pattern I searched the web It gave me so much information. To learn about patterns I want to start from the pattern which I have some examples from my application.
You should look at: http://en.wikipedia.org/wiki/Design\_Patterns and I think this tool will help you: http://dpatoolkit.sourceforge.net Regards, Andrew