Building Maintainable Software, C# Edition by Joost Visser
Author:Joost Visser
Language: eng
Format: mobi, epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2016-06-21T16:00:00+00:00
public class BarChart { private CategoryItemRendererState state = CategoryItemRendererState.DEFAULT; private Rectangle graphArea = new Rectangle(new Point(0, 0), 100, 100); private CategoryPlot plot = CategoryPlot.DEFAULT; private CategoryAxis domainAxis = CategoryAxis.DEFAULT; private ValueAxis rangeAxis = ValueAxis.DEFAULT; private CategoryDataset dataset = CategoryDataset.DEFAULT; public BarChart Draw(Graphics g) { // .. return this; } public ValueAxis GetRangeAxis() { return rangeAxis; } public BarChart SetRangeAxis(ValueAxis rangeAxis) { this.rangeAxis = rangeAxis; return this; } // More getters and setters. }
The static method drawBarChart from the original version is replaced by the (nonstatic) method draw in this class. Six of the seven parameters of drawBarChart have been turned into of BarChart class. All of these have default values. We have chosen to keep parameter g (of type System.Drawing.Graphics) as a parameter of draw. This is a sensible choice: draw always needs a Graphics object, and there is no sensible default value. But it is not necessary: we could also have made g into the seventh private member and supplied a getter and setter for it.
We made another choice: all setters return this to create what is called a fluent interface. The setters can then be called in a cascading style, like so:
Download
Building Maintainable Software, C# Edition by Joost Visser.epub
Building Maintainable Software, C# Edition by Joost Visser.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Coding Theory | Localization |
Logic | Object-Oriented Design |
Performance Optimization | Quality Control |
Reengineering | Robohelp |
Software Development | Software Reuse |
Structured Design | Testing |
Tools | UML |
Deep Learning with Python by François Chollet(12571)
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8299)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7082)
Microservices with Go by Alexander Shuiskov(6851)
Practical Design Patterns for Java Developers by Miroslav Wengner(6770)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6708)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6416)
Angular Projects - Third Edition by Aristeidis Bampakos(6115)
The Art of Crafting User Stories by The Art of Crafting User Stories(5644)
NetSuite for Consultants - Second Edition by Peter Ries(5577)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5381)
Kotlin in Action by Dmitry Jemerov(5065)
