Solved

Objects vs Model Objects

Posted on 2013-06-15
4
363 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
  • 3
4 Comments
 
LVL 74

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This video teaches users how to migrate an existing Wordpress website to a new domain.
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.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now