OOP
OOP
The company I'm working for is moving toward a WebServices Architecture and the project I'm doing has been tapped as the first to implement our new strategy. I have done webservices in the past, but only from a very limited perspective and never using an object oriented model. Now that I've jumped the fence to OOP, I'm not going back. The issue I see in reading up on webservices (and the material may be out of date) is that you can only return primative types or user defined types (as long as they only implement primitive types). What that boils down to is you can return a class from your webservice if it's built something like this:
Public Class MyPerson
Public ID as Integer
Public Name as String
Public Address as String
End Class
You cannot, however, return a class that uses get/set properties and private internal variables such as:
Public Class MyPerson
private _id as Integer
Public Property ID() As Integer
Get
Return _id
End Get
Set(ByVal Value As Integer)
_id = Value
End Set
End Property
End Class
This is a departure from the development style that I've grown accustom to. I am hoping someone can offer some advice in effectively architecting a webservices solution utilizing OOP. Give me your experiences and pitfalls to avoid.
I have been following
Eric Wise's blog for a long time now, as of last week I started working with him. I know that I will certainly grow as a developer working with his influence. For my first project I have adopted his Domain Pattern that he blogged about
here. Unlike some of the other patterns I have used, I was able to get up and running with this one in just a couple of hours. It is easy to use and well thought out. I would highly recommend it to anyone looking to adopt a domain manager pattern for their own development efforts.
The .NET Q&A Blog is now live. It started with an idea that Jay Kimble had to start a blog dedicated to answering questions anyone may have regarding any issue in .NET. The idea is simple, you can go to the blog and use the Contact link on the side to email your issue. The issue then gets stripped of any project specific information (for the protection of the inocent) and posted to the blog for all the other bloggers out there to respond to. The advantage of doing this in a blog is that google seems to index blogs better than forums, so it will be easier for others to find these answers in the future.
In a previous post I mentioned that I want to do a OOP Tutorial here. This is as much for my benefit as for anyone else. I actually am calling on all the bloggers out there to help me with this. I need you all to respond to help me (and others who are not taking advantage of OOP) to cross over and begin using these techniques. My first section is to be on OOP Principles.
Could we start by focusing on the OOP Mindset? Help me and others to understand when, where, and how to use Object Oriented Programming. What goes into deciding when something should be an object?
Any specifics or examples would be great.
As I stated in my last post, I would like to see this category on my blog become a tutorial for OOP. As such I felt it quite beneficial here to reference an article written by Jay Kimble defining the terms.
You can find it here.
Ok, If you have been following Jay Kimble's blog you have read about me and my lack of Object Oriented Programming. It's not that I don't understand what OOP is. It's also not that I don't understand some of the benefits of OOP. My dilema stems from working as a contractor. Two major problems here. First, I have had no-one to mentor me in this area. I lost all professional contact with developers who were better than I about the time my company was embracing .NET and these new technologies. Prior to that I had ample opportunity to learn in the technologies we were using at the time (classic asp, vb 6.0, etc...) but have never had this benefit in the .NET world. The second problem is that now that I'm an independant contractor I have so little time to spend investigating new architecture that I have been afraid to take the leap from my classic coding approach. I am too busy being CEO, Marketing Director, CFO, CTO, Sales Director, DBA, Sr Developer, Grunt Code Monkey, Project Manager, Receptionist, Janitor... ok, you get the idea.
Despite the time crunch I'm facing, I'm getting ready to jump into the OOP pool. I realize that to alieviate some of the time constraints I have, I need to have a more extensive object library. Less coding equals more free time (or more projects one or the other). I'm hoping that some of you may be able to help me with this. I've started a new category here for OOP and hope that all of you will assist me (and hopefully others) in my quest to become Object Oriented. I would like to see it become a tutorial of sorts on OOP. After all, you never know when you may have to maintain my code someday.
My first issue is I need to get into the OOP mindset. I need to get in my head when it's appropriate to write code to do some task inline in the page, and when I should be creating an object to handle this. Please post your suggestions and tips.