From: Peter Booth Date: 2009-08-13T13:16:04+09:00 Subject: Re: Destroying related objects doubt ... basic oop question I think the reality is more complex than either of the two positions espoused here. OR mapping does play a part in this discussion. But the problem isn't OO, it's the opposite. When we use the Active Record design pattern we're saying that the DB schema comes first, and the class model is a second class thing. The productivity gains of Rails shows that, for many applications, this approach is powerful. The weaknesses of this approach emerge when things start getting bigger, and when it's an application product line, and not a single application, that is vital. Perhaps the most intelligent OO book of the last decade is Eric Evan's Domain Driven Design. He describes a compelling approach to building a domain model of classes that accurately models a sophisticated business, and can support a product line of related applications. In this approach it's the object model, not the DB schema, that is king. This approach can lead to treating the DB as merely the persistent representation of the object model. Evan's approach explicitly distinguishes entity objects from value objects and encourages clear ownership policies. There is a great Rails book, Enterprise Rails, that does a good job of bridging these approaches with some of the earlier DB-centric development practices. Peter On Aug 12, 2009, at 5:18 PM, Mike Stephens wrote: > Fabian Streitel wrote: >>> why don't we just write all programs in assembler again? >> Greetz! > > It was shown (30 years ago) that assembler is noticeably less > productive > than 3GLs > and therefore should only be used where ultimate cpu control is > essential. By contrast no-one has justified bringing entity- > relationship > models into object oriented programs. It's just a whim of some over > zealous OO geeks. > >>> I wished we were back in the good ole days... > > There's nothing stopping you... > > Simplez > -- > Posted via http://www.ruby-forum.com/. >