views:

310

answers:

5

Hi,

I'm a research assistant for a university. We're retooling our Software Architecture subject, hoping to "modernize", and address some of the teaching and collaborative learning issues we've discovered in past semesters.

Students are asked to rapidly build a prototype of their architectured system using Eclipse.

For persistence, we've guided students to HSqlDb.

Last semester we received significant feedback that writing the Data Access Layer and mapping to OO has taken alot of time. This plumbing work could be better spent on more relevant things, like scaling, end-to-end perf or satisfying more scenarios.

In a real-world production, I'd pick an ORM tech, like Hibernate, but the subject is already too complex to teach yet another technology (and Hibernate is a massive one to learn for students IMHO).

So, my questions to the SO community:

  • Should we consider giving students an object oriented database (if they still exist)? This saves time on ORM and plumbing
  • Should we stick with RDBMS and tell students to roll their own ORM?
  • Should we point students to a lightweight, simple ORM?

Remember, this isn't real world, but we'd like to teach real world skills as much as possible. Teaching ORM not as important as getting students to rapidly prototype a system that satisfies the scenarios.

Any help is greatly appreciated.

UPDATE Thank you for your responses. I'm a C# dev at heart too (see my previous posts), but unfortunately all the students are only familiar with Java when they come into the subject.

+3  A: 

As someone who embraced OO heartily, and RDBMS grudgingly... I would encourage, even beg, computer science departments to keep theory and practice of relational databases in the foreground. If that can be done even while you use an ORM for the OO classes, then go for it. But I'd prefer to see students coming out of college understanding that OO - relational mapping is hard, and why it's hard, and that this does not mean that the relational model is broken.



Not very broken, anyway.

Dan Breslau
+1  A: 

If the primary goal is for the students to learn, then I think using an RDBMS would be the better approach here - they already have to grok the object model on the application side, so reconciling a relational structure into an overall architectural portfolio is an important skill.

Regarding providing an ORM such as Hibernate, I don't really agree that it is something massive for students to learn. One of the best things about Hibernate is that its difficulty level is fairly well correlated to how deep you dig into it. It has a very low barrier of entry (less than a day IMO) to get rolling with the basics, and often the basics are all you need - especially for something like a prototype, which is what you said is the goal of this activity. Certainly it does not require study to such a degree that it will stick with the students beyond the scope of the course. Basic Hibernate use can be a throwaway skill.

So to summarize, I recommend sticking with an RDBMS and providing an ORM like Hibernate.

Rex M
+4  A: 

I have to wholeheartedly disagree with the use of ORM in an educational environment. You need to be able to walk before you run, and utilizing ORM eliminates a very important step in the learning process regarding using a relational database in an application. You should stick to a VERY lightweight data access framework--one that requires students to write their own SQL and (at best) doesn't allow this scope of the code to be tied to the UI or (at least) doesn't require it.

I am admittedly unfamiliar with the Java world as it relates to actual enterprise development, but I realize (somewhat begrudgingly) that it's THE environment in the educational system. While I believe that students should be exposed to .NET, that's an argument for another time ;) In any even, I'm quite certain that there's some sort of framework out there that satisfies this.

I'd be willing to wager that there is something out there that provides some code generation functionality. At my old job, we only made use of the .NET database libraries to the point of (relatively) low-level reading of the data from the database. We didn't use any of the repositories or change-tracking technologies, but instead rolled our own. SQL commands were written by hand, but the framework still provided type safety and rich designer support. My point here is that both are possible. I would suggest finding something similar to this in Java, requiring the students to hand-code one or two of these adapters to gain an understanding of what goes into them, then have the code generator do the other "gruntwork" plumbing based on their SQL statements.

Don't use any SQL generation. You MUST be able to write the SQL before you let the computer do it for you. The second you use ORM to do something that you don't know how to do in SQL is the second that you've lost control of your database model, and they need to understand that.

Adam Robinson
A: 

I think it depends a lot on what the students know coming into the course. The reason I say this is that it's probably best to start with something they are all familiar with and move forward from there. In my experience, most students understand what objects are and how to use them, so presenting SQL tables as objects seems like a great place to start.

If you agree with me so far, then you might also agree that ORM is a great way to transition young programmers from their comfort zone of object orientated programming into a new world of database programming.

I'm not really familiar with the tools available for Java to implement ORM, but I was able to pick it up in C# (using LINQ to MySQL) in just a few days (after failing miserably at trying to learn PHP for several weeks). If implementing the projects in C# is a possibility, the great thing about using LINQ is that it gives students a feel for how the queries might look in SQL, without leaving their comfort zone of OOP (assuming they are at least somewhat comfortable with developing in .NET). This allows you to teach the concepts of database programming, without spending too much time talking about the implementation of it. Then, once they've mastered the concepts, you can roll back and show them how to perform a similar implementation outside of OOP (using SQL, PHP, JSP, etc.)

Not to mention, it gives them a great preview of how they can use the latest .NET technologies to do some pretty advanced stuff without too much effort (which is probably more beneficial to them in the long term anyway).

Good luck!

ph0enix
+1  A: 

Take a look at DataObjects.Net - is shares benefits of OR/M framework as well as of object database (if built-in storage providers are used), allowing to transparently migrate between supported storages.

It is quite advanced from the point of architecture and extensions: check out e.g. this post about its query optimization techniques.

Alex Yakunin