locked
Object Oriented Design RRS feed

  • Question

  • User79475933 posted

    Question 1:

    I have been developing Microsoft Access database or 10 years and I am now getting into web development. I am very good with normalization and the transition to an object oriented type of develop seems to be a bit confusing. All I can see is to convert all my tables into classes (objects) and of course this is not the way to go.

    Therefore can anyone recommend a good book or link with literature on how to model the business in an object oriented development approach??

     

    Question 2:

    With the aim of learning I have read ASP.net 3.5 unleashed and now reading Pro ASP.net MVC. I find the MVC architecture very interesting and a better way of development. ( I know this guy is now doing web development and saying which way is better. LOL).

    The book is going well but to access the data they are recommending LINQ which I don’t understand. Can someone else recommend another method of accessing the data in my classes? When I did not computing degree we did something called a Façade but all this seems so long ago.

     I welcome all responses!!

    Dallr

    Tuesday, June 1, 2010 4:22 PM

Answers

  • User197322208 posted

    1. Design Patterns GOF , http://en.wikipedia.org/wiki/Design_Patterns

    2. Try Entity Framework /Nhibernate . And yes, on the beginning class per table is the best option


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:36 PM
  • User-821857111 posted

    Most developers who produce OOP applications model their classes according to the Domain they are managing. Often, this model quite closely follows the design of a normalised database (or it should, by and large). Linq To Sql is a tool that translates your schema to classes that represent the objects in the domain, and the relationships between them. It saves on the manual coding, although in the book you reference, Steve Sanderson starts with a model (a simple one at that) and uses that to generate the db schema.

    All I can see is to convert all my tables into classes (objects) and of course this is not the way to go.

    It is one way to go, and there's nothing basically wrong with that approach, especially if you are used to modelling your domain through a database. However, the alternative approach is to adopt a Domain Driven Design approach, which, like Steve's example, starts with the classes, and then generating the database.

    Here's an article that shows MVC without LINQ to SQL, or any other ORM (Object Relational Mapper). It's a straight ADO.NET approach: http://www.mikesdotnetting.com/Article/132/ASP.NET-MVC-is-not-all-about-Linq-to-SQL. But I suggest you try a number of different approaches to see which one you prefer best. That, ultimately, is what your choice will depend on.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:41 PM
  • User-821857111 posted

    Therefore can anyone recommend a good book or link with literature on how to model the business in an object oriented development approach??

    Oh. Forgot about that bit: Beginning C# 2008 Objects. It features a Windows Forms application in the second half of the book, but the first half is a really nice comfortable introduction to OOP and modelling for the app that is featured in the second half.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:48 PM
  • User-525215917 posted

    Answer 1

    It is not such an easy modelling thing that you just turn your tables to classes and you are done. There is impedance mismatch between database modeling and object modeling. It is usually special case when object maps 1:1 to one table. To avoid making modeling mistakes that are hard to fix later I suggest you to read Agile Database Techniques: Effective Strategies for the Agile Software Developer by Scott W. Ambler. This book is specially written for data background people who start moving to object technologies (okay, this book tells more than that but you find there a lot of useful stuff).

    There are also good books on data models - The Data Model Resource Book (two parts) by Len Silverston. Take these books after you are familiar with basic O/R-mapping and object modeling techniques. After that and after some practicing I recommend you to read Analysis Patterns: Reusable Object Models by Martin Fowler (don't start with it because the level of abstractness is very high).

    Answer 2

    ASP.NET MVC is my favorite web applications framework. It is easy and very thin and learning curve is pretty short. The best thing is - source code of ASP.NET MVC is open. If you face troubles you can always see what is going on inside MVC framework. You can make Visual Studio to load debug symbols and source code of MVC so you can easily step through MVC code when debuging your application. 

    For other patterns start with GOF as suggested above. I also recommend you to read Agile Principles, Patterns, and Practices in C# by Robert C. Martin. GOF is pretty abstract and does not focus on technical implementations of patterns. Agile Principles, Patterns and Practices will show you how more common patterns are implemented in code. I also strongly recommend you to read Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin - it is one of the best books on coding styles I have read this far. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:54 PM

All replies

  • User197322208 posted

    1. Design Patterns GOF , http://en.wikipedia.org/wiki/Design_Patterns

    2. Try Entity Framework /Nhibernate . And yes, on the beginning class per table is the best option


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:36 PM
  • User-821857111 posted

    Most developers who produce OOP applications model their classes according to the Domain they are managing. Often, this model quite closely follows the design of a normalised database (or it should, by and large). Linq To Sql is a tool that translates your schema to classes that represent the objects in the domain, and the relationships between them. It saves on the manual coding, although in the book you reference, Steve Sanderson starts with a model (a simple one at that) and uses that to generate the db schema.

    All I can see is to convert all my tables into classes (objects) and of course this is not the way to go.

    It is one way to go, and there's nothing basically wrong with that approach, especially if you are used to modelling your domain through a database. However, the alternative approach is to adopt a Domain Driven Design approach, which, like Steve's example, starts with the classes, and then generating the database.

    Here's an article that shows MVC without LINQ to SQL, or any other ORM (Object Relational Mapper). It's a straight ADO.NET approach: http://www.mikesdotnetting.com/Article/132/ASP.NET-MVC-is-not-all-about-Linq-to-SQL. But I suggest you try a number of different approaches to see which one you prefer best. That, ultimately, is what your choice will depend on.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:41 PM
  • User-821857111 posted

    Therefore can anyone recommend a good book or link with literature on how to model the business in an object oriented development approach??

    Oh. Forgot about that bit: Beginning C# 2008 Objects. It features a Windows Forms application in the second half of the book, but the first half is a really nice comfortable introduction to OOP and modelling for the app that is featured in the second half.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:48 PM
  • User-525215917 posted

    Answer 1

    It is not such an easy modelling thing that you just turn your tables to classes and you are done. There is impedance mismatch between database modeling and object modeling. It is usually special case when object maps 1:1 to one table. To avoid making modeling mistakes that are hard to fix later I suggest you to read Agile Database Techniques: Effective Strategies for the Agile Software Developer by Scott W. Ambler. This book is specially written for data background people who start moving to object technologies (okay, this book tells more than that but you find there a lot of useful stuff).

    There are also good books on data models - The Data Model Resource Book (two parts) by Len Silverston. Take these books after you are familiar with basic O/R-mapping and object modeling techniques. After that and after some practicing I recommend you to read Analysis Patterns: Reusable Object Models by Martin Fowler (don't start with it because the level of abstractness is very high).

    Answer 2

    ASP.NET MVC is my favorite web applications framework. It is easy and very thin and learning curve is pretty short. The best thing is - source code of ASP.NET MVC is open. If you face troubles you can always see what is going on inside MVC framework. You can make Visual Studio to load debug symbols and source code of MVC so you can easily step through MVC code when debuging your application. 

    For other patterns start with GOF as suggested above. I also recommend you to read Agile Principles, Patterns, and Practices in C# by Robert C. Martin. GOF is pretty abstract and does not focus on technical implementations of patterns. Agile Principles, Patterns and Practices will show you how more common patterns are implemented in code. I also strongly recommend you to read Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin - it is one of the best books on coding styles I have read this far. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 4:54 PM
  • User79475933 posted

    When I was learning ASP.net Unleashed 3.5 I asked a number of simple questions and the response rate was quite slow. This slow response rate had me wondering if I should stick around this website/forum.

    Well, the kind of response and good information I recieved from this post I have to change my mind from the aforementioned.

    Guys let me say thanks for the wonderful input and I will be purchasing the books and reading the links accordingly.

    If anyone else wants to add their two cents upon seeing this post please feel free to add your thoughts.

    Thanks again.

     

    Wednesday, June 2, 2010 4:59 PM