|
Working through TaskVision's code, I see they have a middle tier data layer.
On the load of the program, they display a splash page because to instantiate this layer takes a while, this is done by the following :
Dim m_DataLayer as New DataLayer
Now, in other forms (Like AddTask etc), they declare and work with the datalayer like this :
Dim m_DataLayer as DataLayer
.... and then work with datasets, calls to web services etc via this declaration
My question now is, how does this work? If I instantiate a class like that on my main form load, does it mean I can call that specific class from anywhere in my program as described above?
I currently have an application that works with XML files, and I obviously do not have a datalayer, which means everytime I want to call a certain XML file, I have to instantiate an instance of the form that does the loading of the dataset, and then fill that dataset using the functions provided on that form, would a tiered application help me cut down on load time? (8 meg xml file takes 5 or more seconds)
Thanks for your well-formed answer, I appreciate the help | | MigrationUser 1 Friday, July 23, 2004 4:22 PM | My personal version of task vision is actually completely objecte oriented, and I use an O/R mapper (personal) on my objects to take care of persisting to a data store (xml, sql, binary, etc.). When I have to send across the wire however, things become more difficult. Arrays of objects are difficult to serialize to xml, however I like to make everything inherit an abstract class that forces me to override a "ToXml" function - and validate against a schema because I want to make sure if there's a java service on the other end it works.
DataSets make sending across the wire very easy, but if you have another platform things become very hard - handling your own xml serialization has its benefits,and allows very simple documents rather than complex dataset xml documents.
Logically, I still have a DataLayer, but this is handled by my Broker (O/R Mapper's broker)
In my applicatoins I like to take on more XP (extreme programming) methods and experiment as much as possible to see what works and what works better | | MigrationUser 1 Friday, July 23, 2004 9:19 PM | AcidRaZor,
You are asking the same question alot of us are trying to find the "IDEAL" solution to? I too have been experimenting with the O/R Mapper concept and am torn. I still would like to see what the vision of Microsoft is with regards to the Dataset concept in a "Real World" example. Every resource talks about how simple it is to drag and drop a table onto your form and tadda, you have pretty much everything you need to access the data (minus the fill, etc.). Heck, even the new version of Visual Studio creates the code behind for the "Fill" method automatically when dragging and dropping onto the form? I fail to see how this benefits a "Real" project? As for your questions regarding Taskvision datalayer, etc., no you can't access the m_Datalayer from anywhere the way they have instatiated the object. That is why it is created in every form load event. As for speeding up the application by adding a datalayer, I guess my answer would be yes and no? The purpose of a datalayer is to seperate the code for the data manipulation from the interface portion of the project. Speed is achieved only by creating an ideal access method of the data. In other words, you could create the same methods of accessing the data from within your form load event versus seperating it out into a data access layer and the access time will be nearly identical. The real benefit comes from doing exactly what it is you are doing, and that is, you have to create the form object that contains the code to access the data, that in itself is the wrong way to go about it. You would definately benefit from breaking the data access code out of the form and put it into a datalayer class, that way it is accessible to all forms in your application. | | MigrationUser 1 Monday, July 26, 2004 11:16 AM | sorry this is OT - I rebuit alot of dotnetNuke this weekend, and discovered a very nice and simple mapper, should check it out, reduces all the dal code, plus 2.0 is very fast | | MigrationUser 1 Monday, July 26, 2004 2:49 PM | Thank you for your well formed answers, help is much appreciated.
One thing I struggle with though, is getting the XML files (already sitting at 8 meg) into the dataset. Let me rephrase, struggling with the time it takes to actually load INTO the dataset.
What is the best way to do that? (Ties in with going offline with the app and leaving it offline for extended periods of times, for instance if rep's goes to different countries without internet access... and yea, I'm in South Africa, we're close by to ALOT of countries without internet :P ) | | MigrationUser 1 Thursday, July 29, 2004 3:13 PM | i have a little bit trouble creating datalayer like in Taskvision I would like to know what O/R Mapper do you use, i have search for some, but didn't find any that create similar like taskvision did TIA | | MigrationUser 1 Monday, August 02, 2004 9:56 AM | To be honest i don't know what an O/R Wrapper is/does | | MigrationUser 1 Monday, August 02, 2004 3:43 PM | Take a look at this (they are all free, and opensource, and they are all O/R (object relational mappers): http://sourceforge.net/projects/orm-net/ http://sourceforge.net/projects/nhibernate http://www.mertner.com/mm/gentle/
| | MigrationUser 1 Wednesday, September 08, 2004 11:56 PM |
|