• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Learning OO,Patterns and UML

 
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I'm not new to the Java language constructs however knowing the specifics of a language doesn't necessarily make you a good programmer. I want to learn how to decide which classes to make (and which instance variables they should have) given some requirements. Where can I learn these things? A beginner's book would be perfect.
Thanks in advance for any help.
 
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't recommend a book, but I can tell you how I learned OOP. Long years ago I was interested in game development. After developing some games in 2D I decided to go 3D. I found one high-level 3D graphics framework which was 100% object-oriented. I had to learn how classes and objects work in order to be able to create anything. Creating a virtual world with objects and classes turned out to be very "natural". A light is an object, a tree is an object, everything you see is an object. You can create directional light, diffused light, all the kinds of light inherit from the same Light abstract class. Thinking about objects and classes this way is much more "natural" than thinking about very abstract classes as we use in other applications.

The engine I used most was Irrlicht (Ogre3D is also worth to mention), however both are C++ frameworks. There are plenty of frameworks for Java, but I never used any seriously, so cannot recommend anything.
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will reading Head First Design Patterns help me in this context?
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never read this book, but the title hints it's about design patterns. To understand how design patterns works (and to find their beauty) you need to first well understand how OOP works.
 
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book that I would recommend is Martin Fowler's "Refactoring" book. That may seem strange but it's the book that helped me shape my views about design, helped me develop a sensitivity to bad code and design smells, and helped me realize what object orientation is really about: it's about assigning behaviors and responsibilities to the appropriate abstractions in our programs. Head on over to the Design Forum and follow along in some of the longer threads there where we discuss about designs of some sample applications.

Knowing about design principles like SOLID, DRY, and SLAP will give you a strong foundation. Robert Martin's "Agile Software Development : Principles, Patterns, and Practices" is a great reference. Craig Larman has GRASP, General Responsibility Assignment Software Patterns (or Principles). Larman's books are also good and he has a lot to teach about design. Lastly, I will circle back to refactoring and recommend Joshua Kerievsky's "Refactoring to Patterns" book. This combines refactoring and design patterns and I find myself referring to this book often in the course of my daily work.

IMO, the best way to get a lot of practice in good design is learning how to do proper Test-Driven Development. Despite its name, TDD is really more about design than it is about testing. Design thinking and refactoring are very closely intertwined and TDD forces you to think about and do these things every step of the way.
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:The book that I would recommend is Martin Fowler's "Refactoring" book.


I have that book on my bookshelf! The book is indeed great but still it requires a good knowledge of OOP. Without a deep understanding of it a person will not be able to create elegant designs.
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think that the learning process is sequential. You can't just read the one book first, then move on to the next, then the next, and so on. It doesn't work like that, at least for me it doesn't. I typically will bounce around a few books, reading a section here, a section there, trying to get different perspectives and reinforcing and augmenting lessons from one author with lessons from other authors. That's why I cited a number of references rather than just the one. If I were to choose where to start though, I'd say start with Uncle Bob Martin's "Agile Software Development" book, also known as the PPP book, from its subtitle "Principles, Patterns, and Practices" Here you will find good discussions of foundational concepts like the SOLID design principles.
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course using multiple sources is very effective and I learn everything that way as well. But take a look at the topic name, there is "Learning OOP" in the title. It's really hard to learn how and why design patterns work when a person doesn't understand difference between abstract class and interface, or doesn't know how inheritance works, or what is difference between protected and private access. A person should understand the theory behind object oriented programming first and then move toward things like design patterns and other design-related topics.

Think about it as about a person who wants to build a car. What would you recommend to learn first: how to design an engine, or how basic mechanics works?
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you look past the title and read into what OP wrote:

Ashwin Rao wrote:I'm not new to the Java language constructs however knowing the specifics of a language doesn't necessarily make you a good programmer. I want to learn how to decide which classes to make (and which instance variables they should have) given some requirements


I take that to mean that he is already familiar with OOP basics and Java language constructs that support these. Next step for me would be delving deeper into theory of design because that's where you really see the OOP concepts and principles play out. But neither of us is a psychic or mindreader I think, so let's just leave those options out there for OP to consider and let him figure out what works for him. Besides, most of these books do in fact go into OOP concepts, especially the PPP book and Craig Larman's introductory books about OO.
 
Andrew Polansky
Ranch Hand
Posts: 310
18
MS IE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clearly said if OP understands OOP well. If OP already understands fundamental OOP concepts, then I agree with all that you wrote.
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do understand how OOP works (encapsulation,polymorphism and inheritance).
I did find this book. Will it help me further understand OOP concepts?
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry but the link you gave takes me to a login page and I'm not inclined to create an account just for that. What's the title and who's the author?
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book is titled "Head First Object-Oriented Analysis & Design" and authored by " Gary Pollice , Brett D McLaughlin , David West".
Sorry about the broken link! :|
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not familiar with that particular book but I know of Brett McLaughlin and his book(s). Books in the Head First series are generally good for beginners so I guess that should help you get started. But like I said, you should try to read more than just one reference so you can get other perspectives and augment what you learn from each author with information from other authors.
 
Ashwin Rao
Ranch Hand
Posts: 89
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you for your help!
Much appreciated!
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just had a quick look at the book - Safari Books Online is a wonderful resource; if you can get it through your work I highly recommend you do that - the book should be an excellent place for you to start. Looks like folks from Java Ranch even helped review it and at least one moderator is quoted for her feedback about the book. It also has discussions about the SOLID design principles. And right up front, the authors tell you to "go ahead and design something!"
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ashwin,

I think there are a bunch of posts on Coderanch for learning design patterns and UML (UML online and another recent about UML class diagram).
I guess you'll find enough resources here and there's no need to search elsewhere :-)

Hope this helps
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junilu, as suggested i am going to buy Uncle Bob Martin's "Agile Software Development" and Martin Fowler's "Refactoring" book. Though i already have
Head first design pattern and is reading as well. Will it be fine? Should i buy "Head First Object-Oriented Analysis & Design" authored by " Gary Pollice ,
Brett D McLaughlin , David West" as well?

** Note: I have a limited budget.
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tushar, get the Martin and Fowler books if you can, those are classics. It's up to you if you want to get the Head First OOAD book, if you are on tight budget then you may be able to find used copies on Amazon. For you, however, I would recommend Robert Martin's book "Clean Code" - you are ready for it. This book will help get you to the next level and beyond.
 
Tushar Goel
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junillu, i will get "Clean Code".
 
Tushar Goel
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just received book delivery. I will start reading it in a day or 2.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic