Posted in March 2, 2009 ¬ 4:51 pmh.Chris Richards
Ok it works. I also created a checker for the opertators so we don’t get invalid/malicious code. /// /// Returns a DBList of objects that match the Where /// /// Property to Match /// “=”, “<”, “>”, “LIKE” /// Value to Match /// Type of the object to get (Must inherent from DBOBject) /// Connection [...]
Read the rest of this entry »
Posted in March 2, 2009 ¬ 2:05 pmh.Chris Richards
I have two thoughts of what the next step should be. The first is the ability to return a collection of objects (maybe LINQ computable, but I’m not worried about that right now.) The other is that the object should be able to fetch it’s own tags. In my system, each object has tags associated [...]
Read the rest of this entry »
Posted in February 25, 2009 ¬ 4:39 pmh.Chris Richards
Alright, now I have a working .By It actually simplifies things a lot, to the point I’m starting to double think making everything static. As you can see, you can simply call something like: DBUser chris = (DBUser)DBObject.By(“firstname”, “chris”, typeof(DBUser), Utility.connMy); DBUser bob = (DBUser)DBObject.By(“id”, “1327″, typeof(DBUser), Utility.connMy); And get back a valid user. This [...]
Read the rest of this entry »
Posted in February 25, 2009 ¬ 2:44 pmh.Chris Richards
So far I think things are going good. I could even start to use this in the real world. But I’d like to complete a few more features first. Having a .By(Property, Value) method. That way we could get an object by any defined property. Having something like .Get(Property) and .Set(Property) that will return the [...]
Read the rest of this entry »
Posted in February 25, 2009 ¬ 2:37 pmh.Chris Richards
Ok, here is the code with the static modifications.I like this better, but I don’t like the whole “(DBUser)DBObject.FromReader(reader, typeof(DBUser));” (or “(DBUser)DBUser.FromReader(reader, typeof(DBUser));”) thing. It just seems like I’m having to type to much. Then again, the child class could encapsulate some of this passing by type. DBObject /// /// This is the baseclass for [...]
Read the rest of this entry »
Posted in February 25, 2009 ¬ 12:44 pmh.Chris Richards
I haven’t been able to work on this for a while because of school and work. I was rereading my last post and I noticed that I have to create a new DBUser in order to get the SelectQuery for it. I don’t like this, it violates my ‘new’ rule. One of the reasons it’s [...]
Read the rest of this entry »
Posted in January 1, 2009 ¬ 1:37 pmh.Chris Richards
So as I’m thinking about the DBOBject I just created. I ask myself, “Why make a protected method FromReader() vs just using a constructor? Why a protected method and not just a static method?” The way I see it, using the “new” keyword to create a database object should create a table in the database. [...]
Read the rest of this entry »
Posted in December 31, 2008 ¬ 1:03 pmh.Chris Richards
I made some changes so I could display code on the site. Thanks to This guy below is a basic working starting point for the DBObject. It does one very important thing. It can fill it’s self out from a DataReader. /// /// This is the baseclass for DB Object created by Chris Richards /// [...]
Read the rest of this entry »
Posted in December 15, 2008 ¬ 1:46 pmh.Chris Richards
I haven’t worked on this project since school started. It’s finals week so I thought I should start this project again. I think I may have bitten off more than I can chew with this project. It’s become larger and more complicated than I initially imagined. So the first step is to review the goal [...]
Read the rest of this entry »
Posted in August 7, 2008 ¬ 1:37 pmh.admin
Something that I just realized that’s going to be important. I need to be able to get result sets by a Property. For example: user.BySex(“male”); With the way I’ve been going I’m not sure how this will fit into the model, but it’s a feature that must exist. Maybe something like Factory<user>(“Sex = ?1″, “male”);I [...]
Read the rest of this entry »