Welcome

I'm a student and this blogg has been created to keep information on a daily to weekly basis about my project that i am doing to get my Bachelor of Information Technology. This is based on my progress, and a place to put all of my information, not entirely a proper blogg. Though sometimes i feel like i'll be talking to myself... Any ways, enjoy and feel free to comment. If your wondering what this project is and dont want to read every single post, just go to the Proposal link, or any of the "posts worth looking at" below.

Saturday, May 17, 2008

17/5 Summary of Implementation pt.1

Below is what i set out to do for this milestone.


Implementation of Database

  • Install virtual machine and get Microsoft SQL server 2005 up and running.
  • Install Microsoft Visual Studio 2005 on virtual machine (alternatively i can try get hold of a virtual machine with both of these installed.
  • Create database, tables, relationships, stored procedures.
  • Insert fake data

I got my virtual machine up and going with no problems, it already had server 2003 installed on it, so i just had to configure the application server. I got the iso images for Visual Studio and SQL Server and installed those without a problem.

The database creation was quick and easy. I ended up deciding that i'd have 6 tables and take out the user permission one and the intercepting table between user and permissions. I will be implementing the user loging system with visual studio so these tables are not needed.

For each table besides management i created a stored procedure to inser, update, delete and select data from the database. The stored procedures were easy to do, just alot of cutting and pasting really ^^.










Implementation of Business Layer


  • Create project, classes
  • Create webservice
  • Create database connections
  • Create test page to get data

<-- newest UML Diagram (v 3.0)

The first hurdle i had to jump was learning visual C Sharp. After reading alot of MSDN forums, guides and reference pages it wasnt too hard to pick up. Because the .net framework is underlying C Sharp and VB that ive used before it wasnt a huge learning curve. As well as these resources i also talked to my sister about C Sharp, and went over some of my code and got her to compare it to VB for me. Things such as void, in the sense of VB is just sub. After having this talk i was away and going for it.

Throughout the implementation part one i have changed the programming and UML diagrams alot. This is mainly because at first i really didnt have an idea how the backend would actually be implemented, besides which entitys i needed.

The major changes i have made are changing from a dictionary to a list, moving all database connections to another class and adding in a global class.



Change from dictionary to a list

<-- UML Diagram V 2.0 (old)

As you can see in this diagram i originally had a "clsList" for each entity, such as a clsUserList to hold clsUser. The advantage of having a dictionary is that it has a key, then a value Dictionary. This makes the values very easy to search, and sort etc. BUT what i realised is that you cant just pass a dictionary to the interface, but have to send it as an array of some sort and read it back into a dictionary at the other end.

What i decided to do about this was implement a generic list at the backend because only basic searching for editing and deleting needs to be done. This way i can more easily pass the data to the interface and turn it into what i want it to be. I am going to implement a Dictionary at the interface end because alot of searching and sorting is going to be done.

So what i was doing with the dictionary was creating a dictionary (clsUserList for example) and that would hold a key, and the clsUser. This was declared in the clsGlobal:

public partial class clsGlobal : System.Web.HttpApplication
{
public static clsUserList theUserList;

void Application_Start(object sender, EventArgs e)
{
theUserList = new clsUserList();
}

}



Now when the application starts it creates a list of clsUser instead. This meant i could remove all of the lists, and move the edit function into the clsUser.

public partial class clsGlobal : System.Web.HttpApplication
{
public static List userList;;

void Application_Start(object sender, EventArgs e)
{
userList = new List();

dbConnection lcConnection = new dbConnection();
lcConnection.getUserList();
}

}

Creating a database class


Originally i was saving and updating the database from the clsUser itself, and deleting and loading data from the clsUserList. I decided it would be best to seperate all of this code into one seperate class called dbConnection. This holds all the code to connect to the stored procedures in the database. Now the clsGlobal, and service call this class to save, select, update and delete records in the database.


Global Class

I added in the global class in version 2 of the UML diagrams, but i'll go over why again. Basically every time the user called the service it would create a new list. Now if every user creates a new list everytime they access the service, we will be doing alot of calls to the database to fill these lists, and the users will all be adding, deleting and updating different lists. By having the lists declared and created in the global class we are only creating the list once at application start. This way everyone is accessing the same list.


Testing

I created really basic forms to insert, update and delete data. Mmmmm would ya look at that design.

So i made a form like this for jobs, users, client address, management address, management and client. This way i could test the app. For problems i faced see here.










Problems to still fix

Even though i changed from a dictionary to a list, i am still having issues sending it to the interface. Either way its easier to turn the list into an array and send it. I shall figure that one out. I am also just having an issue adding client addresses and management addresses. Probly something minor, only reason i didnt fix it yesterday was because i ran out of time. For more information on my problems and fixes go to here. :D


Conclusion

I finished around 98% of what i needed to do. My time management is getting better, maybe cause i'm finially getting this programming thing so its less frustrating. My skills have definatly improved in my programming and trouble shooting already, though i have to add google makes life alot easier, and about 1000 other people are having the same issue as you i mean me.

After i fix these last little bits and pieces i am gonna move onto the next stage of implementation which i will upload a post about after this one. Neeeed Cooofffeeeee.

Links

http://msdn2.microsoft.com/en-us/library/kx37x362(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/saxz13w4(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/ms173095(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/ms228368(VS.80).aspxhttp://www.oreilly.com/catalog/prognetws/chapter/ch02.htmlhttp://community.sharpdevelop.net/blogs/mattward/archive/2005/10/15/CustomMSBuildTasksForMono.aspxhttp://safari.oreilly.com/0735619093/ch04lev1sec2http://msdn.microsoft.com/en-us/library/0b0thckt(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/s1ax56ch(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/yah0tteb(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/83fhsxwc(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/xfhwa508.aspxhttp://support.microsoft.com/kb/302577http://www.homeandlearn.co.uk/csharp/csharp_s1p5.htmlhttp://www.xmlfox.com/CSsamples.htmhttp://msdn.microsoft.com/en-us/library/6sh2ey19.aspxhttp://msdn.microsoft.com/en-us/library/ddtce152(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/ms178132(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/aa479339.aspxhttp://msdn.microsoft.com/en-us/library/ms173114(VS.80).aspxhttp://msdn.microsoft.com/en-us/vstudio/aa700773.aspxhttp://msdn.microsoft.com/en-us/library/ms173114(VS.80).aspxhttp://msdn.microsoft.com/en-us/library/x53a06bb(VS.80).aspxhttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=308584&SiteID=1http://msdn.microsoft.com/en-us/library/2h3syy57.aspxhttp://msdn.microsoft.com/en-us/library/98bbex99.aspx
http://aspadvice.com/forums/thread/31836.aspx
http://msdn.microsoft.com/en-us/library/6sh2ey19(VS.80).aspx
http://timstall.dotnetdevelopersjournal.com/converting_a_list_to_an_array_and_back_using_generics.htm
http://bytes.com/forum/thread512439.html http://weblogs.asp.net/bhouse/archive/2005/06/14/412382.aspx

No comments: