10 JAVA MAXIMS: The Best Ways to Implement Your Design SJTU CLASS.

Slides:



Advertisements
Similar presentations
What is a scholarship?. A scholarship is a financial award given to a student on the basis of academic achievement and promise.
Advertisements

Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
The Secrets of Practical Verification… © 2008 Think Verification.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
Tietojärjestelmien peruskurssi Software engineering Malin Brännback.
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 2 Software Processes.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
Object-Oriented Analysis and Design Lecture 11 Maintenance (from Schach, “O-O and Classical Software Engineering”)
Applied Software Project Management 1 Introduction Dr. Mengxia Zhu Computer Science Department Southern Illinois University Carbondale.
CSE 219 COMPUTER SCIENCE III PROPERTIES OF HIGH QUALITY SOFTWARE.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 3: Basing Software Development on Reusable Technology.
SM3121 Software Technology Mark Green School of Creative Media.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
© 2005 Prentice Hall, Decision Support Systems and Intelligent Systems, 7th Edition, Turban, Aronson, and Liang 6-1 Chapter 6 Decision Support System Development.
© AgiliX Agile Development Consulting Agile Demystified Cesario Ramos.
Computer Science 240 Principles of Software Design.
BALANCE & Keys to a successful year! TIME MANAGEMENT 101.
Approaches to ---Testing Software Some of us “hope” that our software works as opposed to “ensuring” that our software works? Why? Just foolish Lazy Believe.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Personal Character Chapter 33. Outline  Isn't Personal Character Off the Topic?  Intelligence and Humility  Curiosity  Intellectual Honesty  Communication.
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
Array.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
Module 3 – Release Letting Go so your Team can Support you Effectively.
Agile Programming Principles.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Chapter 2 소프트웨어공학 Software Engineering 임현승 강원대학교
Program Design CMSC 201. Motivation We’ve talked a lot about certain ‘good habits’ we’d like you guys to get in while writing code. There are two main.
Program Development Life Cycle (PDLC)
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
Software Engineering Experimentation Rules for Reviewing Papers Jeff Offutt See my editorials 17(3) and 17(4) in STVR
CSE 219 Computer Science III Program Design Principles.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
CS 350 – Software Design The Strategy Pattern – Chapter 9 Changes to software, like other things in life, often focus on the immediate concerns and ignore.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Documentation. Your documentation must fit the needs of your audience. It’s always better to say one thing that is useful, as opposed to many things that.
22-January-2003cse FunctionalSpecs © 2003 University of Washington1 Functional Specs CSE 403, Winter 2003 Software Engineering
Grade Book Database Presentation Jeanne Winstead CINS 137.
Extreme Programming (XP) XP is an agile methodology: –aims to be responsive to change Theme running through XP is the importance of communication –amongst.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
Interfaces About Interfaces Interfaces and abstract classes provide more structured way to separate interface from implementation
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
SEG 4110 – Advanced Software Design and Reengineering Topic T Introduction to Refactoring.
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Conducting Business Meetings Satorre, Joshua Jerem T. ENSP2 Instructor: Mr. Xavier Aquino Velasco - Associate/Lecturer III, FEU Tech.
ANALYSIS PHASE OF BUSINESS SYSTEM DEVELOPMENT METHODOLOGY.
Building Your Study Skills. Five tips for making the most out of studying: 1.Identify the time(s) of day when studying is the most effective, then schedule.
Continuous Improvement. Start Simple and Continually Improve E.g., Gmail Labels 1.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
CSCE 240 – Intro to Software Engineering Lecture 3.
10 Great Ways to Stop Procrastinating and Get More Done in Less Time Time Management Tips by Arman Sadeghi.
Databases: What they are and how they work
The Software Development Cycle
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
Lecture 25 More Synchronized Data and Producer/Consumer Relationship
6 Recommendations for Driving Business Value from Test Automation.
Design and Maintenance of Web Applications in J2EE
The Object-Oriented Thought Process Chapter 05
Dr. Rob Hasker SE 3800 Note 9 Reviews.
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
“I am definitely going to take a course on time management…just as soon as I can work it into my schedule.” -Louis E. Boone.
Agile software development
The Software Development Cycle
Presentation transcript:

10 JAVA MAXIMS: The Best Ways to Implement Your Design SJTU CLASS

The Best Ways to Implement Your Design Good Java developers write and implement applications swiftly while creating code that is highly logical and reusable. By Bruce Eckel

The Best Ways to Implement Your Design To make your Java code perform as it should—that is, with as few snags as humanly and technically possible—there are certain general rules programmers must follow. These are mostly common-sense solutions, such as using established coding conventions, making sure that the code style is standardized so that a team can best utilize it, and making the code readily available for testing at regular intervals.

The Best Ways to Implement Your Design In the end, your code should be as simple and as accessible (meaning without hidden data) as possible, with the development and milestone ground rules clearly spelled out so that everybody working on the project is on the same page throughout the entire cycle. If you follow these rules closely, your code should require fewer adjustments, test better, and perform at an optimum level.

The Best Ways to Implement Your Design With that in mind, this article contains 10 key maxims for efficiently implementing Java code. Read on... Editor's Note: The tips published here are excerpted from Bruce Eckel's book, "Thinking in Java, Second Edition," (Prentice Hall, 2000). It is the second in a series of articles in which Eckel shares his explicit advice on Java development, design, and implementation.Thinking in Java, Second Edition

1.Elegance always pays off l In the short term, it might seem like it takes much longer to come up with a truly graceful solution to a problem, but when it works the first time and easily adapts to new situations instead of requiring hours, days, or months of struggle to update down the line, you'll reap the rewards in saved time and sanity—even if no one else can measure them. Not only will this strategy yield a program that's easier to build and debug, but your applications will also be easier to understand and maintain, and that's where the financial value lies. It protects your company's investment in the original program development, so that even if every programmer on the original development team moves on to other things, new talent can pick up where they left off. This point can take some experience to understand, because it can appear that you're not being hurry; it will only create inefficiencies productive while you're making a piece of code elegant. Resist the urge to.

2.First make it work, then make it fast First make it work, then make it fast This is true even if you are certain that a piece of code is really important and that it will be a principal bottleneck in your system. Get the system going first with as simple a design as possible. Then, if it isn't going fast enough, profile it. You'll almost always discover that the bottleneck you thought you had isn't really the most critical problem. This will let you prioritize application optimization tasks appropriately and thus save your time for the really important stuff.

3.Remember the "divide and conquer" principle Remember the "divide and conquer" principle If the problem you're looking at is too confusing, try to imagine what the basic operation of the program would be, given the existence of a magic "piece" that handles the hard parts. That "piece" is an object — write the code that uses the object, then look at the object and encapsulate its hard parts into other objects, and so on. This should ensure that you don't end up with programming redundancies, i.e. writing the same piece of application logic multiple times.

4. Separate the class creator from the class user (client programmer) Separate the class creator from the class user (client programmer) The class user is the "customer" and doesn't need or want to know what's going on behind the scenes of the class. The class creator must be the expert in class design and write the class so that it can be used by the most novice programmer possible, yet still work robustly in the application.

5. Name classes intelligently Name classes intelligently When you create a class, attempt to use names that are so clear and self-describing that comments are unnecessary. Your goal should be to make the client programmer's interface conceptually simple. To this end, use method overloading when appropriate to create an intuitive, easy-to-use interface

6. Use bare bones methodology Use bare bones methodology Your analysis and design methodology must account for, at minimum, the classes in your system, their public interfaces, and their relationships to other classes, especially base classes. But anything more than that may be overkill. Ask yourself if all the pieces produced by your methodology have value over the lifetime of the program. If they do not, maintaining them will cost you. Members of development teams tend not to maintain anything that does not directly contribute to their productivity; this is a fact of life for which many design methods don't account.

7.Automate everything Automate everything Write the test code first (before you write the class), and keep it with the class. Automate the running of your tests through a makefile or similar tool. This way, ongoing changes can be automatically verified by running the test code, and you'll immediately discover errors. Because you know that you have the safety net of your test framework, you will be bolder about making sweeping changes when you discover the need. Remember that the greatest improvements in languages come from the built-in testing provided by type checking, exception handling, etc., but those features take you only so far. You must go the rest of the way in creating a robust system by filling in the tests that verify features that are specific to your class or program.

8. Write test code early Write test code early Write the test code first (before you write the class) in order to verify that your class design is complete. If you can't write test code, you don't know what your class looks like. In addition, the act of writing the test code will often flush out additional features or constraints that you need in the class-these features or constraints don't always appear during analysis and design. Tests also provide example code showing how your class can be used.

9. Get abstract Get abstract All software design problems can be simplified by introducing an extra level of conceptual indirection. This fundamental rule of software engineering is the basis of abstraction, the primary feature of object-oriented programming. Get in the habit of using indirection to solve design problems; this skill will serve you well for many, many years to come.

10. An indirection should have a meaning An indirection should have a meaning In concert with Tip No. 9, giving clear, logical definition to indirections is essential to their value. This meaning can be something as simple as "putting commonly used code in a single method." If you add levels of indirection (abstraction, encapsulation, etc.) that don't have meaning, it can be as bad as not having adequate indirection at all. Bruce Eckel is a frequent author and lecturer on software development practices and was a founding member of the ANSI/ISO C++ committee. He provides public and private seminars and design consulting in C++ and Java. Reach him at