Archive for the ‘DBObject’ Category

DBObject.Where

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 [...]

  • Share/Bookmark
Read the rest of this entry »

Next step.

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 [...]

  • Share/Bookmark
Read the rest of this entry »

DBObject rev .03

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 [...]

  • Share/Bookmark
Read the rest of this entry »

Next Steps

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 [...]

  • Share/Bookmark
Read the rest of this entry »

DBObject rev .02

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 [...]

  • Share/Bookmark
Read the rest of this entry »

Static again

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 [...]

  • Share/Bookmark
Read the rest of this entry »

Decisions

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. [...]

  • Share/Bookmark
Read the rest of this entry »

DBObject

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 /// [...]

  • Share/Bookmark
Read the rest of this entry »

School is almost over!

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 [...]

  • Share/Bookmark
Read the rest of this entry »

Design

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 [...]

  • Share/Bookmark
Read the rest of this entry »