Results 1 to 12 of 12

Thread: [RESOLVED] transitioning to OOP methodology experiences

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    63

    Resolved [RESOLVED] transitioning to OOP methodology experiences

    I happen to change my code from traditional vb 6 to a little bit of .net, and so It took me a few weeks to eventually change some parts of it, being the only developer here (without oop experience), so I am still struggling, any good book out there that you can suggest where there are a lot of code examples from analysis to programming?


    thanks
    Last edited by layne; Jul 6th, 2008 at 07:55 PM.

  2. #2
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: transitioning to OOP methodology experiences

    A great book for coding concepts is Code Complete 2. While not specifically OO orientated this book does provide many useful code examples and general good practice rules for coding. The examples are in Visual Basic and Java I believe so it should be easy to follow.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    63

    Re: transitioning to OOP methodology experiences

    Have you ever had any experience inheriting a working system from another developer which you tried to get your head into that code but not quite understand it? Well, that is my dilemma now, I need to support this new .net application which has soooo many classes creating from different classes which creates objects from different classes and so on, but the output is just 2 web methods that calls some stored procedure?

    wow, i guess i'm in trouble now...

  4. #4
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: transitioning to OOP methodology experiences

    Unfortunately there is no book that will help you with that. That is basicly a common mistake of may developers taking OO design too literaly. My suggestion would be if it is plausible to rewrite to code as you may end up spending more time trying to figure out how to read the old code than you would trying to write the new code.

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: transitioning to OOP methodology experiences

    Quote Originally Posted by layne
    I happen to change my code from traditional vb 6 to a little bit of .net ...
    Not sure what that mean, though:

    - are you migrating your VB6 app to VB.Net?
    - or you are trying to use some of OOP in VB6?

    Quote Originally Posted by DeanMc
    Unfortunately there is no book that will help you with that...
    There are plenty of books (great, good and not so...) - here are two that are great:

    - OOP in VB6
    Programming Microsoft Visual Basic 6.0 by Francesco Balena

    - OOP in VB.Net
    Programming Microsoft Visual Basic .NET by Francesco Balena

    -----------------------------------------------------------------------

    However, OOP was never considered as best programming approach - it does have lots pros but just as many cons.
    One of the major con is OOP has tremendus overhead (in VB.Net every data type is an object so it makes even worst) so if not properly used your app may blow (basically it eventually eat up your system's memory).
    In VB6 on the other hand Strings, Integers, etc data types are not objects and that means none of them will require as much memory as similar data types in VB.Net.
    It is up to programmer (or perhaps architect) to decide which way to follow or find best compromise.
    Is it possible to avoid using objects in these days? Most probably not but it doesn't mean that someone is required either - let's leave that to purists only...

    Regards.

  6. #6
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: transitioning to OOP methodology experiences

    @ RhinoBull: None of those books will teach the OP how to maintain his code. The issue is not that the code takes the OO approach, rather the issue is the original author of the code did not know enough about OO to make production code that was elegant and easy to handle.

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: transitioning to OOP methodology experiences

    Quote Originally Posted by DeanMc
    ... to make production code that was elegant and easy to handle.
    Vast majority of code out there is just like that - you have to learn how to read somebody else's code and develop your own style just for purpose and (as already mentioned) there is no book to teach you to do that.
    It takes time to develop your coding style that is easy to read and maintain, it may take a lifetime [without success] for someone however.
    OOP or not shouldn't really matter ...

    Look at some samples that are easy for you to read and perhaps learn from any of them - we have of plenty of those arround here.

    Good luck.

  8. #8
    Fanatic Member Dnereb's Avatar
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    863

    Re: transitioning to OOP methodology experiences

    To support RhinoBulls litrature suggestion

    Programming Microsoft Visual Basic 6.0 by Francesco Balena

    Was my Bible while programming VB6.0 and it made a big difference because it made the step to VB.Net easier

    - OOP in VB.Net
    Programming Microsoft Visual Basic .NET 2003 by Francesco Balena

    Is My bible today, I Just Peak in to the 2005 edition for new things because the 2003 version is setup like the VB6.0 version and the 2005 isn't
    why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
    for every question you ask provide an answer on another thread.

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: transitioning to OOP methodology experiences

    Remember not to go for a class-by-class conversion. Look at the bigger picture and if you have a good understanding of the application, redesign it.

  10. #10

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    63

    Re: transitioning to OOP methodology experiences

    Rhino, what I mean is, i've created an app using .net but without inheritance and class objects, just plain procedural, calling methods within methods and stuff like that. Now, I've tried re-writing the code to have some sort of 'Class' and i've created objects and called methods of those objects, so my program is somewhat OOP now, but not 100%.
    Now, this new app that was turned over to me uses purely OOP without inheritance but using so many namespaces from the same solution, and so many classes that creates objects, but those created objects have the data type of another class which is linked to another class, etc, oh well!

  11. #11
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: transitioning to OOP methodology experiences

    Quote Originally Posted by layne
    ... my program is somewhat OOP now, but not 100%...
    There is asolutely nothing wrong with that - as I said 100% is for purists.

    Quote Originally Posted by layne
    ... but using so many namespaces from the same solution ...
    Imaging creating a class with say few dozens of properties.
    Now, you need to use just a few of them but you still need to create new instance of that class first.
    So, you'll end up with allocating memory for the entire class instead of what's necessary for say 2 integers.
    Is that a waste? IMHO it is. 100% OOP is affecting performance - under sircumstances a lot.
    If you want to learn OOP to full extent then use one of those books and create some test app for your own purpose but I suggest not to go crazy about it in any of your production applications.

  12. #12

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    63

    Re: transitioning to OOP methodology experiences

    yep, thanks, will do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width