Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

How many ASP.NET developers program using OO (e.g. using get, set)?

6 years ago I developed and maintained a .Net 1.1 Intranet application that had no get/set.

So how about today? Worth trying the pure OO route?

Thanks,

TDG

share|improve this question
3  
"Pure OO" is an overloaded term. For example, ruby programmers will tell you that you can't program "pure OO" in C# because int is not an object and + isn't a method. –  nikie Feb 16 '11 at 11:11
2  
Why limit it to ASP.NET, how many developers program in any language or environment in a 'pure OO style'. –  GrumpyMonkey Feb 16 '11 at 11:35
2  
Since when do you need get/set methods on classes to program OO? You can create your own (like in Java, right?) like getVariable1() and setVariable1(). Here's a summary of stuff which belongs to the OO mindset: en.wikipedia.org/wiki/Object-oriented_programming. –  Jan_V Feb 16 '11 at 12:20
    
It's just I was reading this asp.net book, and it briefly went over OO in a few pages, and mentioned properties and get/set code examples. –  TeaDrinkingGeek Feb 16 '11 at 14:12
    
Even if you decide to go the Public field route, why is that violation of OO principals? –  Morons Feb 16 '11 at 15:29
show 1 more comment

4 Answers

up vote 5 down vote accepted

Your question of "how many" is probably impossible to answer. In general it is certainly a viable option to use OO concepts with ASP.NET. I've worked on some fairly large ASP.NET applications that had many different assemblies divided into tiers with full-fledged OO concepts, patterns, etc. I've also worked with small ASP.NET projects that just "make things work" and have all of the business logic in the myButton_Click handler. And then there are many in-betweens.

You have to decide, based on the project needs, whether the additional up-front investment of "heavy OO" is worth it in the long run. On a sufficiently large project, it might be the only viable option. But smaller projects can definitely "get away" with the quick-and-dirty method and be successful.

Also, as an aside, you seem to equate "get/set" with OO. This is a weak association at best, and certainly not the most core concept with OO. Separation of concerns, polymorphism, encapsulation, etc. are all much more important to OO than get/set.

share|improve this answer
    
Thanks for ur answer. –  TeaDrinkingGeek Feb 16 '11 at 14:11
    
+1 for the heavy OO comment. Rigid OO is it's own expense most times –  Bill Feb 16 '11 at 15:59
add comment

If you think that using get/set is "pure OO", then you've seriously misunderstood the principles of OO design. You might find http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html helpful to start thinking about OO differently.

Please don't be put off by the fact that that example is in Java. Good OO design is reasonably language agnostic.

share|improve this answer
    
Sorry my questions wasn't best put. I was just mentioning about what I read today in an ASP.NET book that gave an example of get/set for beginning OO. I just wondered how many ppl actually program that way all the time, especially those who use ASP.NET –  TeaDrinkingGeek Feb 16 '11 at 16:49
add comment

Today is pretty much the same. Many web developers just make things work. Sad, but true. They are using ready components, and the development is mostly based on "click here, then click there, and F5". Of course the code quality sucks, but somehow it works, so why bother (they think).

share|improve this answer
5  
I disagree - code is just an artifact of the product. Getting it working is more important than spending three times as long to make your code look beautiful. –  rmx Feb 16 '11 at 15:10
5  
Those "ready components" where made to be used, and SHOULD be used. Using those components make your code better NOT worse. –  Morons Feb 16 '11 at 15:16
add comment

Having seen many projects over many years, I'd say things are improving. If you think about it, the first ASP.NET developers transferred from classic ASP. Classic ASP had little support for OO programming (though it was big on nested includes), so the classic ASP procedural style transferred to ASP.NET, even though VB and C# were better equipped to handle OO concepts.

Today, many new professionals are trained using OO design and there are a host of open source projects to learn from. More interestingly, I see more functional influences in the last 2 years. Linq is a real game changer.

And yes, more structured design - either OO or functional - is worth it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.