software analysis .... Start with UML or Design Patterns? [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am a java programmer with 2 years experience, I really like programming, especially OO programming, and if I have a project, I start with programming directly, without any system analysis operations, so my code is not sorted as it should be, I want to learn how to write and design a good code, should I start learning UML or I can go directly through Design patterns ? and what are the best books for learning UML and Design Patterns.
Thanks a lot for your time

Start with a broad-brush design, where you identify the major parts of your solution. You can use UML for that, but it's not mandatory.
Then, start writing tests, or executable specifications, and evolve the code to meet those tests. Use your broad-brush design as a guide, and also the tests. Practice test-driven development. Solicit feedback from your stakeholders. Iterate. Iterate. Iterate.
(Of course, that depends a lot on the type of application that you do, I'm assuming business-like, non-safety-critical software).
As for books, look at "Domain Driven Design" and "Growing Object Oriented Software, Guided by Tests".
Oh, and never start with design patterns...

UML is a means to an end, and by no means the only one. Try it and see if you like it, personally I'm not too fond of it. You need to discover yourself how you want to think about and design your applications. Personally I like drawing boxes on a whiteboard.
Design patterns can be useful but they describe solutions to more specific problems. A pitfall here is that people that start off with design patterns try to apply them everywhere. They try to match a design pattern with a problem, but it should be other way around. UML and Design Patterns are in no way mutually exclusive and they don't (necessarily) serve the same purpose.
As far as design patterns are concerned, I found Head First Design Patterns to be a nice and easy to read book, although this is terribly subjective as I know a lot of people who really hate the writing style of the Head First books.

UML is a way to represent a model, it's not a replacement for the model. The model can be expressed in UML, but not only in UML.
Design patterns help creating the suitable model and avoiding common mistakes. Personally, I found books by Martin Fowler and Eric Evans very useful, but I'm sure there are many other good writers as well.

There's no recipe for learning how to design code, it's about experience.
well, after 15+ years of assembly/basic/pascal/java/c/c++/C# and another gazillion languages sometimes my code is just not sorted as it should (or could be), still I'm well payed and generally considered a good programmer.
Too many reasons behind that, tight release dates, too fast evolving tech, dumb client requirements, monstrous frameworks designed only thinking about extendability (it's this even an English word) and not focusing on usabiliy.
When I start a new project, the first thing I do is have a coffee.
Then I contact the customer (or whoever will use the application) and try to get a grasp on what they really need. Understanding what the client needs is the real goal (after getting paid of course ^^)
After this, I took pencil and paper and draw, not following any standard. Boxes, circles, arrows, with notes, some kind of artistic brainstorming.
Design patterns... best way to use them is avoid them. Too often they don't match real life problems, but programmers all over the world are abusing them everywhere, yes, mainstreaming leads to that. But if you feel the absolute reason to use them, start with the GoF beast (Design Patterns: Elements of Reusable Object-Oriented Software: Erich Gamma, Richard Helm, Ralph Johnson e John Vlissides).
2 years is just a small amount of time. Designing good code requires a bit more time (and of course experimenting with different languages)

The best book available for design patterns is the book 'Design Patterns: Elements of Reusable Object-Oriented Software' By the Gang of Four. The latest version of this book also includes an UML book in the package. Together this will be a good start.
However, just implementing design patterns is wrong. When you want to learn to write and design good code, understanding when to use patterns (and when to develop your own!) is a must.

Related

How to get interest in programming especially in java and android [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am new in this community. I just completed my Btech in Computer science, I have interest towards programming especially java. I started studying java but i am little bit slow in logic and understanding the concepts. I have some good books of java but when doing the program i am losing my confidence because of the logic issues. I have some doubts
How can i improve my logical and coding skills
HOw to get real interest in programming.
Is there any shortcut for studying programming
Please provide some suggestions as i knew this forum has lots of good programmers. Please share ur thoughts and how you people improving ur logics.
Any help is appreciated
Perfect way is to start with the language you love. The syntax you like. The things you know. For example, suppose you know C++ and you are a bit familiar with it. Of course, you had done any of the language before in BTECH. So, go start up with that. Go through some basics of that to intermediate. And, if you're new to programming, then don't jump towards deep nor visit the Forum's guide post until you face the same problem. Make simple programs. Ask experts for your problems and when you feels yeah I learnt so much from my self and community, start digging the complex scenerios of that language. (Here, language can be any programming. For your case, Java)
Whenever you got perfect in your own loving language, it would be easy for you to switch any of the language because all languages are same probably. Mostly, some syntax changes and some component, feature or etc changes.
Write code. Read code. Study code. Breath code.
If you aren't interested already then (1) will be a bit hard
No, you just have to put the time in and do it
At the end of the day, the real way to become a better programmer it to use your tools more and to research proper methods of using those tools. There are no short cuts, there is no go direct to go and collect $200.
As for interest in coding. I find that my interest for various projects waxes and wanes but at the end of the day, I still have a voracious apatite for solving problems and writing code. I don't know if that can be learned.
1) By practice and even more practicing.
2) Don't you have an interest you can combine this with? It's hard to find a hobby that can't use any software.
3) If there is a shortcut it's probably no good.
4) Why do something you're not interested in?
first of all
*3. There is no shortcut
you have to be patience and passionate in order to learn coding.
*2. See thing in computer, and be curios how the engineers make things so easy and simple that any person can do much complex task in a seconds
and
*1. In order to improve your logic you need to keep coding, more you code more you get sharpen, solve puzzles, and maths problems, and to learn good coding style head first java and Head First Design Patterns is the best book that I found, which I personally love to read.

Is there an Online Programming Bible? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm interested in Programming especially in Java. Is there a page, which explains different informatics topics in Java or generic for all OOP languages? I mean something wikipedia-styled, but more understandable and just for programming/informatics.
Maybe with exercises, but basicly it should explain different problems of informatics.
There are a lot of good online resources for learning Java, and many of them will teach you good OOP practices as well.
The Java Tutorials
Java API Specification
Thinking in Java 4th ed. by Bruce Eckel
The Java Language Specification
The Java Virtual Machine Specification
For programming in general though, I recommend Structure and Interpretation of Computer Programs.
For programming topics on Java, go to the Oracle (Sun) Java site. That's the holy grails of everything regarding Java. For a Wikipedia-style format, just go to wikibooks (as it will have topics on Java and other programming languages, not just OO.)
Other than that, a short answer to your question will be simply NO. Programming is too complex a topic for someone to create the type of material that you are asking.
If you are seriously interested in programming (and I mean seriously), focus on one language alone and learn it (as opposed to looking for the perfect language or trying to analyze all possible alternatives and falling into "paralysis by analysis".)
Again, if you are serious...
just pick one of the following:
C
Python
Ruby
Scala
C would make you face the nitty gritty of computing and people have been successful in learning programming with C as its programming languages (don't let OO and/or Ruby/Python/Java/.NET fanboys tell you otherwise.)
Python and Ruby are extremely beautiful languages that will teach to program, and do not force you to make everything into an object (a really retarded idea, more on that below.) Scala is another elegant and effective alternative.
Learn The Fundamentals of Programming First, the OO Analysis and Modeling (not the other way around
Avoid languages that force you to write everything in objects. That includes Java and C#. I've been working with Java for 12 years now, and it is a reliable platform. But it is a retarded language in that it does not allow you for procedural programming. Not everything is an object nor should be modeled as an object, sometimes not even in complex systems. People are still grappling with how to program correctly using a OO paradigm and they keep failing because they still don't get the capabilities and limitations of OO modeling and analysis.
So my suggestion is not to learn programming with Java (or C#). Go with the hard procedural (C) or the elegant, paradigm-agnostic (Python, Ruby or Scala.) Focus on modularity, structured programming and algorithms. Then, later you will be better equipped to truly understand where OO languages fit in.
I'm not going to delve into why I chose these 4 options or why I advise against Java and C#. That debate has been discussed a plenty and you can find it easily in stackoverflow and/or google. That's just my suggestion, from my experience (Java and otherwise), a suggestion that I always give to those serious about learning programming.
In the end, it doesn't really matter which of those four you pick. Just flip a coin, pick one and stick to it until you are decent with it. Focus on learning proper programming techniques, problem decomposition and algorithms rather than on the language itself.
Good luck.
edit:
I forgot to mention, if you are serious about learning programming, buy books. You won't learn from visiting sites. And you have to put your time in it (we are talking 4hrs a day at least... I don't see anyone learning programming with anything less than that.) Anything less is just make-believe going through the motions of learning.
I strongly recommend imo the best book written about Java.
Effective Java by Joshua Bloch
http://www.programmingpraxis.com could help you a lot since i go through most of the examples from there.Have a look.
EDIT:
http://www.cs.sunysb.edu/~skiena/392/javaprograms/
http://projecteuler.net
Continuing the Bill's recommendation
http://www.artima.com/insidejvm/ed2/jvm.html
Effective Java by Joshua Bloch.
I would recommend these: Sun Tutorials,
FreewareJava.com,
java2s

How to design Java application? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
What are the general guidelines and best practices to keep in mind while designing Java application [Simple console apps to J2EE apps]?.
Hi
I recently completed Java programming tutorial from Sun
and practised core java (I have previous programming experience).
Now I understand the basics of Inheritance, Abstraction , Polymorphism,Encapsulation
Now i am writing Java code without much difficulty, but am not sure of application design.
This is my main problem: "DESIGNING" the application.
Say if i have given a task to create an application in Java,
What should I start up with? How to think about?
Any formal/informal guidelines I should follow while developing class hierarchies? I am really confused (abstract class or interface or sub class..?).
Should I start by model everything, before writing code?
It would be very useful for people like me to have a SET OF GENERAL GUIDELINES/BEST PRACTICES, which we can follow while start developing a new java application.
Please provide me some guidelines/thoughts/books/resources/tools I should read or Use
Thanks in advance
Scott
It is difficult to give really general advice as there are so many different Java apps on different domains. However, one absolutely recommended book is Domain Driven Design by Eric Evans. See also Wikipedia for a short intro on it.
General advice:
don't try to design everything up front - do a reasonably good design which enables you to start coding, then refactor as your understanding of the problem domain and the implementation deepens
try to divide difficult problems into smaller parts/steps/modules which you can tackle one by one
try to think in terms of objects with well defined responsibilities, which (more or less) model the problem domain and cooperate to solve a problem / handle a task
becoming good at design requires practice, first and foremost; don't be afraid to make mistakes. However, when you do, analyze them and learn from them as much as you can
learn design patterns, but don't be overzealous - use them only when they really solve a problem and make your code cleaner
In my opinion it all boils down to meeting the below
easy to understand
easy to maintain and evolve
multiple developers able to
contribute to the project (mostly in
parallel)
To achieve the above there are certain guidelines and principles that are suggested by experts based on experience which are
Follow layered architecture
Follow the SOLID principles within and across layers. All the design patterns are one way or the other help achieve these principles only. SRP: Single Responsibility Principle, OCP: Open Closed Principle, LSP: Liskov Substitution Principle, ISP: Interface Segregation Principle, DIP: Dependency Inversion Principle
DRY and KISS principles
These guidelines and principles are independent of any programming paradigm or language. However, OOP languages help implement these easier.
There are various paradigms (very often 3 letters acronyms) :
DDD : Domain Driven Design
SDD : Serviice Driven Design
MDA : Model Driven Architecture (code and architecture is extracted from the UML model)
TDD : Test Driven Development (validation tests are implemented before the application)
With theses key-words, you'll find a lot of informations on the web.
In J2EE, I would say that the SDD is the most used (it is now very "normalized", even if I'm not sure it is the best solution) : service (software "intelligence") > domain (bean objects used for persistance) > DAO (persistance).
Now DDD is becoming more and more used : the conception is refocused on domain objects, which are taking the "software intelligence" layer.
I really advice you to take a look at GRASP principles, it gives you a good design basis skills.
Welcome to stack overflow.
If you are good with Java, read Head First Design Patterns.
and
Head First Object-Oriented analysis and design - er, may be in reverse order :)
Start by looking up UML Class diagrams that will get the ball rolling in the right direction, then take a look at Gang of Four design patterns. That is an excellent first step.
http://en.wikipedia.org/wiki/Class_diagram
http://en.wikipedia.org/wiki/Design_Patterns
Lastly, I would pour over good open source code like the Spring Framework
http://www.springsource.org/
I'd recommend emergent design with TDD.
I think there is nothing specific to Java design : if you already know about Object Design, you're ready to go !
Do not start coding immediately without having any design. But this does not mean that you should design all before coding. Because from my previous experiences, I could not have any design which does not need corrections. Especially if you are new in a programming language your design will change according to the features of the language you are using and the libraries available. My advice is to have a general design which is based on the most important aspects of object oriented design such as inheritance, polymorphism, encapsulation etc. Starting from this general design and the needs you encounter while programming, revise your design accordingly.
As much as you get experienced in the language, your first general design will fit in a much more efficient way to your program.
Although most of the people say that one object oriented design should be able to be written in any object oriented language, it is not that easy to have a very good generic design like that. To be more realistic, disregarding the language that is used for implementing a particular design is not a good way as far as I am concerned.
Well odds are what you'll be doing has already been done before - at least something similar. Luckily, there's lots of open-source stuff nowadays. So if you really have no idea, one thing you can do is download several open-source applications that do the same thing and study them. It should give you a good start.

Good problem domain for introduction to OO project?

I'm working with someone who's looking to get back into programming after several years of IT support work. They know all the iterative programming basics and have used them frequently, but their only object-oriented programming experience was in college. The goal is to come up with a decent-sized project that is good for illustrating and practicing OO concepts. Has anyone ever used or thought of a good problem domain for an introduction to OO? I'm looking for a domain where concepts such as inheritance, abstraction and polymorphism really make sense and provide an advantage when modeling with the classes.
Of course, I did some googling and found the popular ATM and Address Book OO examples. They're both pretty good, but ATM is a little more complex than what I'm looking for. Address Book may be decent, but I think it might not be complex enough, or a clear enough domain for modeling objects. The goal is for the project to take a decent amount of effort to complete, not something that can be completely done in an afternoon or two.
As for implementation specifics, the project will be implemented as a Java console app with a minimal UI. Learning the OO concepts and how to implement them in Java is the primary purpose of this app.
How about a text based adventure game?
I like casino game simulation. Simulation is one of the application domains that lead to the development of OO programming. Casino games are relatively simple but with some sophistication.
You can look at http://homepage.mac.com/s_lott/books/oodesign.html.
Along the same lines as address book, a general catalog (cds, books, dvd, equipment & so on). The idea here, you have a base item that is extended by all the other types (inheritance) and each one can implement a specific interface for display and other purposes (polymorphism).
When I've taught other people how to understand OO-principles, I've asked them to relate to OO-programming as if they were building a house. A house has everything you need.

Java Developer looking for a 2nd'ary language to play with [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is best language to learn next to Java?
Criteria for this secondary language are:
High potential of being the "next big thing". e.g. If the market for Java open positions hypothetically dies/dwindles, what is the next programming language that will have a bigger market for open positions? Another way to frame this question is: If I own a small company that implements solutions in Java, what is the other language that I should use?
Can produce web applications.
Can produce desktop applications.
Easy and fun to learn.
Wide range of available libraries and frameworks (free or open source) that enhance and speed up your solutions.
Python almost meets all of them, but I don't know about being "the next big thing", but hey, Google uses it, and I think its popularity is raising.
It's a scripting language, btw.
I use it for web applications (using django), and you can definitely create desktop applications with it (although I haven't done that myself).
It is easy and fun! (although this is quite subjective, but it's tons easier and "funner" than Java)
For employability: Any of the .Net languages, probably C#. Then you're well set for most potential customers.
For stretching yourself: something functional (F# to cover .Net too?), or something Lisp, or Smalltalk - was once the next big thing but it probably never will be again, but still a language that changed signficantly my approach to programming in other languages.
If you are expert in java, you will probably really enjoy groovy.
It is backwards compatible with java and has a lot of the nice features of ruby and similar dynamic languages. It also has what is shaping up to be a nice rails-a-like in grails, and a good object-relational mapping framework in GORM.
What is really nice about it is you can mix and match groovy classes and java classes. So if you find yourself forgetting the groovy syntax, you can just drop into Java. And of course you can get at any Java library from it. At the same time you can benefit from groovy's really concise idioms for things like Beans properties.
(By the way it meets all your criteria listed above, too)
Learn a language that will probably not be the Next Big Thing™. Learning a new language usually means learning new concepts (unless you learn one that's very similar to another one you already know).
Learning new concepts has great advantages, no matter which language you program in, so it's a pretty good thing to do.
If you limit yourself to a language that's going to be the Next Big Thing™, then chances are that you'll find a lot of familiar concepts and only relatively few new ones (the IT world is conservative like that).
Learn something that looks interesting to you. Not only will you be able to learn faster, if it's interesting, but you'll also have more fun doing so!
How about Scala or JavaScript? Functional paradigms will stretch your thinking further and will be of benefit whether they are "the next big thing", or not.
Go for a different paradigm : functionnal, lisp, haskell, ocaml, erlang, scala, etc.
If you don't have any religious issues with Microsoft, I would argue for C#.
The only downside I can see is that it's not cross-platform. Otherwise it fits your requirements as far as I can see
Your criteria fairly closely matches Python and Ruby, they both have a growing market base in Web development, and are fully capable of producing desktop applications as well. Whilst they are fairly closely matched, Python has a slightly larger library of re-usable code modules, whilst Ruby's strength leans more to it's well-established frameworks.
As a side-note, You should ensure that you don't stop at 2 languages. Start learning a second one, then pick up a third and even fourth as you progress. Learning new programming languages becomes a more trivial task as the general learning curve evens out.
I must second Gilles here; to learn a different paradigm is very rewarding, and functional programming is [not unlikely to be] the Next Thing.
Erlang is great both in flexibility, ease of use (once you grasp the basic ideas) and - the best of all - it it very well suited for the high parallelism of future and current hardware. It also covers all your five criteria, though it might be more of a "server" language than a "desktop" language.
If you are interested, I suggest the book Programming Erlang by Joe Armstrong.
Personally, I'd go with Ruby and focus on running your Ruby scripts under JRuby. this way you get the expressiveness of Ruby with the JVM running your code. I've seen Rails and Merb running under Glassfish. Might seem odd, but you get all the nice instrumentation of Glassfish with your Ruby code. Things like JMX, RMI, etc. work well with JRuby.
Squeak by Example

Categories

Resources