Solved

Objects vs Model Objects

Posted on 2013-06-15
4
373 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

695 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