When maintaining or refactoring an unfamiliar database, you'll need a fast way to uncover all sorts of facts about the database, its tables, columns keys and indexes. SQL Server's plethora of system catalog views, INFORMATION_SCHEMA views, and dynamic management views contain all the metadata you need, but it isn't always obvious which views are best to use for which sort of information. Many of us could do with a simple explanation, and who better to provide one than Rob Sheldon?… Read more
Refactoring code won't cause performance problems, right? This was the assumption when Chris Hurley and his team went out to improve some legacy code. They decided to separate the database access from business logic and standardise on Entity Framework, but when it came time to test the code using real-world workloads, unexpected performance issues appeared. Chris recounts how they discovered, investigated, and resolved these issues using ANTS Performance Profiler. … Read more
Refactoring a database object can often cause unexpected behavior in the code that accesses that object. In this article, adapted from his excellent book, Defensive Database Programming with SQL Server, Alex Kuznetsov discusses several techniques that will harden your code, so that it will not break, or behave unpredictably, as a result such changes.… Read more
Where applications are evolved by gradually molding them to a growing understanding of the business domain, this presents great challenges to database development. If databases are designed too loosely, and initial errors are allowed to fester, the results become harder and harder to refactor until eventually they constitute a database time bomb. Thomas LeBlanc describes how to avoid a few basic, but very common, database time bombs. … Read more
Responsive Web Design is devised to help you render your website or web-based application appropriately on different sizes and aspect ratios of browser windows. Adopting it as a solution comes at a cost: It can't help to render a particular design on a specific device such as a model of smartphone. It also can require considerable refactoring of an existing site design, its navigation and testing. It has to be done right.… Read more
Test-Driven Development (TDD) involves the repetition of a very short development cycle that begins with an initially-failing test that defines the required functionality, and ends with producing the minimum amount of code to pass that test, and finally refactoring the new code. Michael Sorens continues his introduction to TDD that is more of a journey in six parts, by implementing the first tests and introducing the topics of Test doubles; Test Runners, Constraints and assertions… Read more
Test-Driven Development (TDD) relies on the repetition of a very short development cycle Starting from an initially failing automated test that defines the functionality that is required, and then producing the minimum amount of code to pass that test, and finally refactoring the new code. Michael Sorens continues his introduction to TDD that is more of a journey in six parts, by implementing the first tests and introducing the topics of Test Naming, Mocking Frameworks and Dependency Injection… Read more
Alex Kuznetsov describes the agile principles, techniques and tools that allowed his development team to make frequent database refactoring a reality, without disrupting users. He explains how this allowed his team to apply an iterative, evolutionary approach to the design and development of their databases, as well as applications.… Read more
CSS is still a valuable way of specifying the rendered style of HTML objects. By using a preprocessor to assist in generating the CSS, it can make it much simpler to develop and maintain a consistent style in a web development, despite the increasing complexity of the CSS standard. Sass and Compass, for example, can deliver clean, organized, and efficient CSS code, as Edward demonstrates.… Read more
Alex's team of developers are geared to doing rapid development of database applications in a busy corporate setting, yet take considerable time over meticulous database design, extensive constraints, automated tests, error logs, and defensive coding. Why? Because it cuts down on the subsequent need for maintenanc… Read more
We’ll be looking at a typical database ‘migration’ script which uses an unusual technique to migrate existing ‘de-normalised’ data into a more correct form. So, the book-distribution business that uses the PUBS database has gradually grown organically, and has slipped into ‘de-normalisation’ habits. What’s this? A new column with a list of tags or ‘types’ … Read more
When Agile meets 'Big Design', the result can be frustration on both sides. Is it possible for database development to to easily coexist with Agile methodologies for application development? Nick suggests that the technical solutions already exist, and the dissonance is more due to cultural and organisational problems… Read more
Although the methodology of refactoring code has been adopted enthusiastically, the same has not really been the case with databases. Nick argues that the reason could lie in the extent of the task of unpicking complex databases systems sufficiently to make them more efficient and effective; and this will only be ameliorated with better tools and planning to support the techniques.
… Read more
Bad Code Smells are similar in concept to Development-level Antipatterns. They don't describe bad programming aesthetics and you can't sniff them out precisely with code metrics. They describe code in need of refactoring in rich language such as 'Speculative Generality', 'Inappropriate Intimacy' or 'shotgun surgery'. They're useful because they give us words to describe antipatterns that we all come across in code. Nick Harrison explains...… Read more
Database refactoring can greatly improve the efficiency of your database code. However, even a seemingly simple database refactoring such as "Move Column" can be tricky to implement correctly in a production environment. In this article, Scott Ambler and Pramod Sadalage describe a rigorous process for the correct implementation of an appropriate refactoring. … Read more