D
dkode
Guest
I am laying out a static class diagram and a use case diagram in Visio for a new application I am making
Now,
I am having a very difficult time getting UML and object oriented ideas through my head.
I began by making a DataAccess class with some basic methods like so:
GetDS(ByVal sql As String)
- this runs the specified sql string and returns the dataset
GetDS(ByVal sql As String, ByVal dataTable As String)
- Overloaded GetDS Method for specifying what dataTable to put the results into. I did this so i could get a dataset with a specific table and then merge the returned dataset with another ds i might have with other relevant information in it
SaveDS(ByVal ds as DataSet)
- this saves the passed dataset back to the database
SaveDs(ByVal ds as DataSet, ByVal dataTable As String)
- saves the passed dataset datatable back to the database
I also have a business object that my other business objects derive from:
BusinessObject
Methods:
- GetDS(sql)
- GetDS(sql, dataTable)
- SaveDS(sql)
- SaveDS(sql, dataTable)
Derived classes from BusinessObjects:
Project - Inherits BusinessObject
Methods:
- GetAllProjects() : Returns a dataset with all projects
- GetProjectByID() : Returns a dataset with the specified Project
- Save(ds) : Saves the specified dataset back to the database
Employee - Inherits BusinessObject
Methods
- GetAllEmployees() : Returns a dataset with all employees
- GetEmployeeByID() : Returns a dataset with specified employee
Now, I think I am almost there with understanding n-Tier architecture, i just a few simple questions about my structure above:
1. Am I on the right track here with creating the right objects to do the right things? I dont feel like I am?
2. I just started looking into typed datasets and would like to use them in this application but I have no idea how to work them into my static structure diagram or how to properly use them. Is there a good doc I can read about implementing typed datasets into my architecture
3. If i implement the structure above, I would need to place my sql statements into my Project and Employee objects which your not supposed to do. My understanding is all SQL queries are to be placed in the data layer?
4. If I am passing all of this information back and forth with datasets, how does vb.net know which tables to insert the data into when I pass the dataset back to the data layer? would i need to specify another string for the table to save to?
5. I also read something about Collections of objects, Is this the way I want to go? I couldnt find any information on making Collections of Business Objects?
I guess I just need some direction as to where to go from here. Thank you.
Now,
I am having a very difficult time getting UML and object oriented ideas through my head.
I began by making a DataAccess class with some basic methods like so:
GetDS(ByVal sql As String)
- this runs the specified sql string and returns the dataset
GetDS(ByVal sql As String, ByVal dataTable As String)
- Overloaded GetDS Method for specifying what dataTable to put the results into. I did this so i could get a dataset with a specific table and then merge the returned dataset with another ds i might have with other relevant information in it
SaveDS(ByVal ds as DataSet)
- this saves the passed dataset back to the database
SaveDs(ByVal ds as DataSet, ByVal dataTable As String)
- saves the passed dataset datatable back to the database
I also have a business object that my other business objects derive from:
BusinessObject
Methods:
- GetDS(sql)
- GetDS(sql, dataTable)
- SaveDS(sql)
- SaveDS(sql, dataTable)
Derived classes from BusinessObjects:
Project - Inherits BusinessObject
Methods:
- GetAllProjects() : Returns a dataset with all projects
- GetProjectByID() : Returns a dataset with the specified Project
- Save(ds) : Saves the specified dataset back to the database
Employee - Inherits BusinessObject
Methods
- GetAllEmployees() : Returns a dataset with all employees
- GetEmployeeByID() : Returns a dataset with specified employee
Now, I think I am almost there with understanding n-Tier architecture, i just a few simple questions about my structure above:
1. Am I on the right track here with creating the right objects to do the right things? I dont feel like I am?
2. I just started looking into typed datasets and would like to use them in this application but I have no idea how to work them into my static structure diagram or how to properly use them. Is there a good doc I can read about implementing typed datasets into my architecture
3. If i implement the structure above, I would need to place my sql statements into my Project and Employee objects which your not supposed to do. My understanding is all SQL queries are to be placed in the data layer?
4. If I am passing all of this information back and forth with datasets, how does vb.net know which tables to insert the data into when I pass the dataset back to the data layer? would i need to specify another string for the table to save to?
5. I also read something about Collections of objects, Is this the way I want to go? I couldnt find any information on making Collections of Business Objects?
I guess I just need some direction as to where to go from here. Thank you.