Solved

Objects vs Model Objects

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

914 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

14 Experts available now in Live!

Get 1:1 Help Now