The Education of a Programmer (Me)

Just another WordPress.com site

Month: September, 2013

Better days since

Well, I have a skeleton site up that implements an .edmx file in the Models folder and maps to the respective tables and I have basic CRUD pages which will work when I launch it in test mode. It’s uglier than sin, but it’s getting there.

I’ve been working through some other tutorials for MVC4 so I can make sense of ways to do this on my own and do a better job with formatting and database updates. I do feel immensely better because it is all coming together. I’ve found it’s easier for me to get it when I’m writing it rather than reading about it.

The nice part of the most recent tutorials I’m working through is that I am getting experience with Ninject, Moq, and unit testing in VS2012. I think I have finally turned a corner and am starting to make more sense of what I want to do and how to do it the best way possible.

Frustrations Abound

I’ve read the start of the quote, “These are the days which try men’s souls,” and have now found a way to certainly apply that in my career. I’m trying to re-build some vintage ASP VB6 sites. Currently, I’ve cleaned them up and made them workable, except for one page because the Oracle back end for that table uses a CLOB data type and VB6/ASP can’t handle CLOBs.

What I really want to do is use MVC 4, Entity Framework, and ODP.NET to create something workable and aimed toward being there in the long run. (Basically, I don’t want to have to do a major re-write in 3 years when the database is switched from Oracle to SQL Server and it all becomes easier.) Therein lies the problem. Wiring up 2 of the 3 components isn’t difficult. I can get EF and MVC4 to work well as I can get EF and ODP.NET to play nice, but add in all three and I feel like I’m in uncharted territory. So I’m going to start blogging and documenting what I’m discovering in hopes that someone else might have some info (if anyone else reads this) and can help me find the pieces I’m missing, or will be able to follow my trail into this and hopefully get something productive out of my morass.

I can do the first part on this rig. (I have two rigs I work out of, one faces the world and the other faces a private subnet that doesn’t have outside access.) So I create an MVC4 project and ensure the latest jQuery, ODP.NET, and EF are all part of the puzzle. I have some ideas of the different controllers and models I’m going to need on the first project. It’s the administration piece which will access existing data tables for a program which monitors events as they happen and sends notification emails to subscribers based on agency, call type, and/or the number of responding units. (There is also a portion for notifications based on the address of the event). So I need to administer the subscribers, the locations, and the call types. The subscribers need to be administered overall, but need to also be filtered by the agency to whom they “belong” as well as the agencies to which they subscribe. The locations need to be administered overall and certain groups of locations need to be gathered together for supervisors to monitor. The call types and subtypes need to be administered to determine when we need to make changes to automatic emails. Plus I have a couple of data grids which show what’s in the pipeline being evaluated and what has been sent out to subscribers. Overall, this shouldn’t be hard. I have 3 CRUD areas and a couple of simple dataset queries. Again, this isn’t rocket science. I already have the tables in place, so I don’t need Code First, I need Database First.

I can connect to the database on the second rig and when I create the project,  I create it on the second rig (from the first one) so there won’t be any problems with it pulling up and being able to code. I can edit the web.config file so I can connect to the Oracle DB. (I’ve gotten decent at that) and I know the queries I need at each stage. I should be able to put all of this together easily, but I’m just not making the last connections to link MVC4 through EF to ODP.NET to reach the DB in a meaningful CRUD environment.

Well, more later…..