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.
要求学生使用Eclipse快速构建其架构系统的原型。
For persistence, we've guided students to HSqlDb.
为了坚持不懈,我们引导学生学习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.
上个学期,我们收到了重要的反馈意见,即编写数据访问层并映射到OO已花费了大量时间。这种管道工作可以更好地用于更相关的事情,例如扩展,端到端性能或满足更多场景。
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).
在现实世界的制作中,我选择了像Hibernate这样的ORM技术,但是这个主题已经过于复杂而无法教授另一种技术(而Hibernate对于学生来说是一个很大的学习恕我直言)。
So, my questions to the SO community:
所以,我对SO社区的问题:
- 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?
我们应该考虑给学生一个面向对象的数据库(如果它们仍然存在)?这节省了ORM和管道的时间
我们应该坚持使用RDBMS并告诉学生自己推出ORM吗?
我们应该为学生指出轻量级,简单的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.
请记住,这不是现实世界,但我们希望尽可能地教授现实世界的技能。教学ORM并不像让学生快速建立满足场景的系统原型一样重要。
I'm a C# dev at heart but the students are only familiar with Java when they come into the subject.
我是一个C#开发人员,但是当他们进入这个主题时,他们只熟悉Java。
5 个解决方案
#1
5
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.
我必须全心全意地不同意在教育环境中使用ORM。您需要能够在运行之前行走,并且利用ORM消除了在应用程序中使用关系数据库的学习过程中非常重要的一步。您应该坚持使用非常轻量级的数据访问框架 - 一个要求学生编写自己的SQL并且(最好)不允许将此范围的代码绑定到UI或(至少)不需要它。
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.
我确实不熟悉Java世界,因为它与实际的企业发展有关,但我(有点不情愿地)意识到它是教育系统中的环境。虽然我认为学生应该接触.NET,这是另一个时间的争论;)在任何情况下,我都非常确定那里有某种框架可以满足这一要求。
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.
我愿意下注那里提供一些代码生成功能的东西。在我以前的工作中,我们只使用.NET数据库库到(相对)低级读取数据库中的数据。我们没有使用任何存储库或更改跟踪技术,而是使用了我们自己的存储库。 SQL命令是手工编写的,但框架仍然提供了类型安全性和丰富的设计器支持。我的观点是两者都有可能。我建议在Java中找到与此类似的东西,要求学生手动编写这些适配器中的一个或两个以获得对它们的内容的理解,然后让代码生成器根据它们的SQL执行其他“gruntwork”管道工作声明。
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.
不要使用任何SQL生成。在让计算机为您完成之前,您必须能够编写SQL。第二个你使用ORM做一些你不知道如何在SQL中做的事情是你失去对数据库模型的控制的第二个,他们需要理解这一点。
#2
3
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.
作为一个热心拥抱OO和RDBMS勉强接受的人......我鼓励甚至乞求计算机科学部门将关系数据库的理论和实践保持在前台。如果即使在为OO类使用ORM时也可以这样做,那么就去做吧。但是我更愿意看到学生们从大学那里了解到OO关系映射是困难的,为什么它很难,而且这并不意味着关系模型被打破了。
Not very broken, anyway.
反正也不是很破碎。
#3
1
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.
如果主要目标是让学生学习,那么我认为使用RDBMS将是更好的方法 - 他们已经不得不在应用程序方面理解对象模型,因此将关系结构与整体架构组合进行协调是很重要的技能。
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.
关于提供像Hibernate这样的ORM,我并不认为这是学生学习的重要内容。关于Hibernate的最好的事情之一就是它的难度水平与你深入挖掘它的深度相关。它具有非常低的进入门槛(不到一天的IMO)来实现基础知识,而且通常只需要基础知识 - 特别是像原型这样的东西,这就是你所说的这项活动的目标。当然,它不需要学习到这样的程度,以至于它会坚持超出课程范围的学生。基本的Hibernate使用可能是一次性技能。
So to summarize, I recommend sticking with an RDBMS and providing an ORM like Hibernate.
总而言之,我建议坚持使用RDBMS并提供像Hibernate这样的ORM。
#4
1
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.
看一下DataObjects.Net - 分享OR / M框架和对象数据库(如果使用内置存储提供程序)的好处,允许在支持的存储之间透明地迁移。
It is quite advanced from the point of architecture and extensions: check out e.g. this post about its query optimization techniques.
从架构和扩展的角度来看,这是非常先进的:例如,这篇文章关于它的查询优化技术。
#5
0
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.
我认为这很大程度上取决于学生们对课程的了解。我说这个的原因是,最好从他们熟悉的东西开始,然后从那里开始。根据我的经验,大多数学生了解对象是什么以及如何使用它们,因此将SQL表作为对象呈现似乎是一个很好的起点。
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.
如果您同意我的意见,那么您可能也同意ORM是将年轻程序员从面向对象编程的舒适区转变为数据库编程新世界的绝佳方式。
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.)
我不是很熟悉Java可用于实现ORM的工具,但是我能够在几天之内用C#(使用LINQ to MySQL)来解决这个问题(在尝试学习PHP几周之后失败了) 。如果在C#中实现项目是可能的,那么使用LINQ的好处在于它让学生了解查询在SQL中的外观,而不会离开他们的OOP舒适区域(假设他们至少在开发中感觉很舒服) 。净)。这使您可以教授数据库编程的概念,而无需花太多时间来讨论它的实现。然后,一旦他们掌握了这些概念,您就可以回滚并向他们展示如何在OOP之外执行类似的实现(使用SQL,PHP,JSP等)
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).
更不用说,它给了他们一个很好的预览,他们可以使用最新的.NET技术来做一些非常先进的东西,而不需要太多的努力(无论如何,这对他们来说可能更长远)。
Good luck!
#1
5
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.
我必须全心全意地不同意在教育环境中使用ORM。您需要能够在运行之前行走,并且利用ORM消除了在应用程序中使用关系数据库的学习过程中非常重要的一步。您应该坚持使用非常轻量级的数据访问框架 - 一个要求学生编写自己的SQL并且(最好)不允许将此范围的代码绑定到UI或(至少)不需要它。
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.
我确实不熟悉Java世界,因为它与实际的企业发展有关,但我(有点不情愿地)意识到它是教育系统中的环境。虽然我认为学生应该接触.NET,这是另一个时间的争论;)在任何情况下,我都非常确定那里有某种框架可以满足这一要求。
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.
我愿意下注那里提供一些代码生成功能的东西。在我以前的工作中,我们只使用.NET数据库库到(相对)低级读取数据库中的数据。我们没有使用任何存储库或更改跟踪技术,而是使用了我们自己的存储库。 SQL命令是手工编写的,但框架仍然提供了类型安全性和丰富的设计器支持。我的观点是两者都有可能。我建议在Java中找到与此类似的东西,要求学生手动编写这些适配器中的一个或两个以获得对它们的内容的理解,然后让代码生成器根据它们的SQL执行其他“gruntwork”管道工作声明。
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.
不要使用任何SQL生成。在让计算机为您完成之前,您必须能够编写SQL。第二个你使用ORM做一些你不知道如何在SQL中做的事情是你失去对数据库模型的控制的第二个,他们需要理解这一点。
#2
3
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.
作为一个热心拥抱OO和RDBMS勉强接受的人......我鼓励甚至乞求计算机科学部门将关系数据库的理论和实践保持在前台。如果即使在为OO类使用ORM时也可以这样做,那么就去做吧。但是我更愿意看到学生们从大学那里了解到OO关系映射是困难的,为什么它很难,而且这并不意味着关系模型被打破了。
Not very broken, anyway.
反正也不是很破碎。
#3
1
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.
如果主要目标是让学生学习,那么我认为使用RDBMS将是更好的方法 - 他们已经不得不在应用程序方面理解对象模型,因此将关系结构与整体架构组合进行协调是很重要的技能。
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.
关于提供像Hibernate这样的ORM,我并不认为这是学生学习的重要内容。关于Hibernate的最好的事情之一就是它的难度水平与你深入挖掘它的深度相关。它具有非常低的进入门槛(不到一天的IMO)来实现基础知识,而且通常只需要基础知识 - 特别是像原型这样的东西,这就是你所说的这项活动的目标。当然,它不需要学习到这样的程度,以至于它会坚持超出课程范围的学生。基本的Hibernate使用可能是一次性技能。
So to summarize, I recommend sticking with an RDBMS and providing an ORM like Hibernate.
总而言之,我建议坚持使用RDBMS并提供像Hibernate这样的ORM。
#4
1
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.
看一下DataObjects.Net - 分享OR / M框架和对象数据库(如果使用内置存储提供程序)的好处,允许在支持的存储之间透明地迁移。
It is quite advanced from the point of architecture and extensions: check out e.g. this post about its query optimization techniques.
从架构和扩展的角度来看,这是非常先进的:例如,这篇文章关于它的查询优化技术。
#5
0
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.
我认为这很大程度上取决于学生们对课程的了解。我说这个的原因是,最好从他们熟悉的东西开始,然后从那里开始。根据我的经验,大多数学生了解对象是什么以及如何使用它们,因此将SQL表作为对象呈现似乎是一个很好的起点。
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.
如果您同意我的意见,那么您可能也同意ORM是将年轻程序员从面向对象编程的舒适区转变为数据库编程新世界的绝佳方式。
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.)
我不是很熟悉Java可用于实现ORM的工具,但是我能够在几天之内用C#(使用LINQ to MySQL)来解决这个问题(在尝试学习PHP几周之后失败了) 。如果在C#中实现项目是可能的,那么使用LINQ的好处在于它让学生了解查询在SQL中的外观,而不会离开他们的OOP舒适区域(假设他们至少在开发中感觉很舒服) 。净)。这使您可以教授数据库编程的概念,而无需花太多时间来讨论它的实现。然后,一旦他们掌握了这些概念,您就可以回滚并向他们展示如何在OOP之外执行类似的实现(使用SQL,PHP,JSP等)
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).
更不用说,它给了他们一个很好的预览,他们可以使用最新的.NET技术来做一些非常先进的东西,而不需要太多的努力(无论如何,这对他们来说可能更长远)。
Good luck!