Solved

Objects vs Model Objects

Posted on 2013-06-15
4
370 Views
Last Modified: 2013-06-22
Is there a difference between custom objects and model objects? I see that with ASP.NET MVC they have very streamlined object classes, which they usually hold in the Model Folder. The classes seem to be made-up mainly of Properties, and no real methods. A while back, I learned that objects are made of Properties and Methods, so with Web Forms, should my custom objects be essentially Properties as with many MVC Models, or should I have all my Object specific methods defined in the class?
0
Comment
Question by:userTester
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 150 total points
ID: 39250763
It depends on your goal. There are various schools of thought on whether or not data objects should have behavior. The main thing would be to pick an approach and stick to it throughout your solutions.

Generally speaking, models don't have methods save for maybe an IsValid method or similar.
0
 

Author Comment

by:userTester
ID: 39250830
Thanks for that kaufmed.

So the methods that relate to a data object could be put in a web pages code behind, and the model could be in a separate object.cs file that holds mainly properties?

For example: a Product database table could have a Products web page (.aspx and .aspx.cs), and a separate Product.cs page that holds the model?

There could also be other Helper type classes which might contain methods used by many different objects of the application?
0
 

Author Comment

by:userTester
ID: 39264580
Is there any more feedback you can give me with respect to my last comment?
0
 

Author Closing Comment

by:userTester
ID: 39268940
Thanks, appreciate your reply!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Service FileSystemwatcher isse 9 46
need help with share buttons 11 66
Asp.Net Session Question 2 33
C# LINQ 5 19
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question