Noback - Principles of Package Design Creating Reusable Software Components
Here you can read online Noback - Principles of Package Design Creating Reusable Software Components full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: New York, year: 2018;2014, publisher: APRESS, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
Principles of Package Design Creating Reusable Software Components: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Principles of Package Design Creating Reusable Software Components" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Noback: author's other books
Who wrote Principles of Package Design Creating Reusable Software Components? Find out the surname, the name of the author of the book and a list of all author's works by series.
Principles of Package Design Creating Reusable Software Components — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Principles of Package Design Creating Reusable Software Components" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
This book is for sale at http://leanpub.com/principles-of-package-design
This version was published on 2015-03-31
* * * * *
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.
* * * * *
To life just out
and long familiar
This book assumes you are a developer writing object oriented code every day. Asyou design new classes, you constantly ask yourself (or your co-worker): doesthis method belong here? Is it okay for this class to know about ? Do I haveto define an interface for this class? Is it important to the other class that Ireturn an array? Should I return null
or false
?
While you are working on a class, there are many design decisions that you haveto make. Luckily there are also many wise people who have written about classdesign, whose ideas can help you make those decisions. Think about the SOLIDprinciples, the Law of Demeter, design patterns, concepts like encapsulation,data hiding, inheritance, composition. If you like to read about these subjects,you will know much about them already. But if you dont then you may still applymany of these principles just because you have some kind of programmersintuition for them.
So you know your way around classes. The classes you produce make sense: theycontain what you would expect them to contain, no more, no less. You can look atthe code of a class and see what it is supposed to do. But now some of thosewell-designed classes start to cluster together. They form little aggregates ofcode that cover the same subject, do something in a similar way, or are coupledto the same third-party code. They belong together, so you put them in the samedirectory, or in the same namespace. In other words you are creating packages*of them.
And just like you are very conscious about the way you design your classes, youimmediately start asking yourself some questions about the design of thepackages you create: can I put this class in the same package, or does itdeserve a new package? Is this package too big and should it be split? Is itokay if package A depends on package B?
Unfortunately, many developers dont have definitive answers for thesequestions. They all use different rules when it comes to package design. Thoserules are the result of discussions on GitHub, or worse: they are based on gutfeelings of the lead developers of well-known open source projects. But guessinghow to do package design is not necessary at all. We dont have to inventpackage design principles ourselves again and again. We can stand on theshoulders of giants here.
One of those giants is Robert C. Martin, a person I very much admire because ofthe clarity and strength with which he speaks about the principles that shouldgovern your work as a software developer, both with regard to the quality ofyour code,as well as the quality of you as a human beingwho creates software.
Robert wrote about package (or component) design principles on severaloccasions. I first learned about these principles when reading the articlesavailable for download atbutunclebob.com.Then I watched some of his videos about component design oncleancoders.com in which he explained the sameprinciples again, but in a more urgent manner.
These package design principles are actually not difficult to understand (infact, they are much more straight-forward than the SOLID principles of classdesign). They provide an answer to the following questions:
- Which classes belong inside a package and which dont?
- Which packages are safe to depend on and which arent?
- What can I do for my users to enhance the usability of a package?
- What can I do for myself to keep a package maintainable?
The discovery that there exist such clear answers to these questions has led meto undertake this effort: to learn more about these package design principles asexplained by Robert Martin, then to explain and discuss them in a broader way.
I think that to learn about these package design principles will be of great useto you. If you have never created a package before you will know from the startwhich principles should govern your package design decisions. And if you havealready created a few, or even many packages, you will be able to use the designprinciples to fix design issues in existing packages and make your next packageeven better.
The majority of this book covers package design principles. But first we mustconsider the contents of a package: classes and interfaces. The way you designthem has great consequences for the characteristics of the package in which theywill eventually reside. So before considering package design principlesthemselves, we first need to take a look at the principles that govern classdesign. These are the so-called SOLID principles. Each letter of this acronymstands for a different principle and we will briefly (re)visit them in the firstpart of this book.
The second part of the book (the main part) covers the six majorprinciples of package design. The first three are about cohesion. While classcohesion is about which methods belong inside a class, package cohesion isabout which classes belong inside a package. The package cohesionprinciples tell you which classes should be put together in a package, when tosplit packages, and if a combination of classes may be considered a package inthe first place.
The second three package design principles are about coupling. Coupling isimportant at the class level, since most classes are pretty useless on theirown. They need other classes with which to collaborate. Class design principleslike the Dependency inversion principle help you write nicely decoupledclasses. But when the dependencies of a class lie outside its own package, youneed a way to determine if its safe to couple the package to another package.The package coupling principles will help you choose the right dependencies.They will also help you recognize and prevent wrong directions in the dependencygraph of your packages.
Let me add some quick notes about the code samples in this book. Although thisbook tries to be agnostic about programming languages, the code samples arewritten in PHP. Its the programming language I know best, which is convenientfor me. However, it should be no problem at all to understand it if you are morefamiliar with other programming languages.
The sample code should not be considered useful in production. It just triesto bring across some technical points. You shouldnt copy/paste it into yourprojects (it wouldnt even execute well in most cases).
At many places I abbreviate the code samples using ...
, in particular when theexact statements are irrelevant for the example. I repeat as little of the codeas possible in subsequent modified pieces of the same code, for brevity andclarity.
One last note: when the code samples contain interfaces, their name always hasthe suffix Interface. I personally dont think this is best practice, but Idid it nonetheless because this way it should be easier to remember which thingsare classes and which are interfaces.
Font size:
Interval:
Bookmark:
Similar books «Principles of Package Design Creating Reusable Software Components»
Look at similar books to Principles of Package Design Creating Reusable Software Components. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book Principles of Package Design Creating Reusable Software Components and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.