Writing Clean Code in PL/SQL & SQL
Brendan Furey, Cornerstone
PL/SQL was first released in 1992 as a procedural language for Oracle that allowed direct embedding of SQL. Since then other types of programming paradigm, including object orientation (OO) and functional programming (FP), have become popular outside the database world.In this talk we will discuss how to write PL/SQL APIs with embedded SQL in ways that promote maintainability and testability. We'll discuss best practices in the use of traditional features such as private, public and nested scoping of methods and variables, as well as appropriate use of newer OO features; we'll explain how FP concepts can help us write cleaner code even without advanced FP features such as lambda expressions. Modular construction of complex SQL will be included. Usage advice will be justified with reference to traditional software engineering concepts, such as information hiding and module cohesion and coupling.Ideas will be illustrated with a mix of schematic examples and publicly available code. Attendees should learn:
Consultant database developer with around 25 years experience in many industries, currently working in the Finance sector. Blogger, Europhile and United fan.