SOLID Design Principles applied in JavaIonut Bilica
Video: https://www.youtube.com/watch?v=0cU-4LrcWI0
SOLID Design Principles applied in Java: rules to develop scalable and easily maintainable code
Speaker: Ionut Bilica - Senior Software Developer @ Luxoft Romania.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will asses how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
Workshop: Refactoring Legacy PHP: The Complete Guide Junade Ali
PHPConf Asia 2018 Workshop by Junade Ali
It’s no secret that software is often written poorly. In commercial environments, developers will regularly find themselves facing technical debt and find that the ability to refactor code is an essential skill to master. As Martin Fowler famously wrote: "Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Due to bad design in software, delivering value to the client can become ever more difficult and stressful until bad software design decisions are rectified. For developers working on badly designed projects, making repayments on technical debt, whilst also delivering value is a key skill – this session will explain how it is possible to square-the-circle and both deliver value whilst paying down technical debt.
Unfortunately far too many developers consider refactoring as a risky task filled with code that’s ridden with var_dumps and debug breakpoints. This session seeks to teach attendees that refactoring can be a safe, everyday task during normal software development and that it is indeed healthy to refactor software mercilessly, especially when operating in an Agile environment with changing software requirements.
This session will feature a hands-on demonstration of how to refactor a legacy app through a combination of automated testing, faster releases and merciless refactoring.
Practical experience in automated software testing and continuous integration are vital learning outcomes and this session seeks to expose attendees to tools like Docker, PHPUnit, Selenium and PHP Mess Detector. Beyond testing, we’ll cover the Code Smells that help developers weed out where the problematic code is.
Gaining a firm grounding in Object-Oriented Programming when refactoring PHP is invaluable and as such, this session will take a deep-dive into Polymorphism, SOLID principles and anti-patterns. After nailing down Object-Orientation, we’ll discuss how we can move legacy software architecture to suitable Design Patterns.
Extreme Programming practices will be presented as a key discussion point on how developers can help achieve these goals.
Design Principle and Design Pattern examples on C# .NET Core.
(Note: Not all the contents are original, I copied some of them from online tutorials while learning and found great explanations. A great thanks to all for this information.)
SOLID Design Principles applied in JavaIonut Bilica
Video: https://www.youtube.com/watch?v=0cU-4LrcWI0
SOLID Design Principles applied in Java: rules to develop scalable and easily maintainable code
Speaker: Ionut Bilica - Senior Software Developer @ Luxoft Romania.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will asses how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
Workshop: Refactoring Legacy PHP: The Complete Guide Junade Ali
PHPConf Asia 2018 Workshop by Junade Ali
It’s no secret that software is often written poorly. In commercial environments, developers will regularly find themselves facing technical debt and find that the ability to refactor code is an essential skill to master. As Martin Fowler famously wrote: "Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Due to bad design in software, delivering value to the client can become ever more difficult and stressful until bad software design decisions are rectified. For developers working on badly designed projects, making repayments on technical debt, whilst also delivering value is a key skill – this session will explain how it is possible to square-the-circle and both deliver value whilst paying down technical debt.
Unfortunately far too many developers consider refactoring as a risky task filled with code that’s ridden with var_dumps and debug breakpoints. This session seeks to teach attendees that refactoring can be a safe, everyday task during normal software development and that it is indeed healthy to refactor software mercilessly, especially when operating in an Agile environment with changing software requirements.
This session will feature a hands-on demonstration of how to refactor a legacy app through a combination of automated testing, faster releases and merciless refactoring.
Practical experience in automated software testing and continuous integration are vital learning outcomes and this session seeks to expose attendees to tools like Docker, PHPUnit, Selenium and PHP Mess Detector. Beyond testing, we’ll cover the Code Smells that help developers weed out where the problematic code is.
Gaining a firm grounding in Object-Oriented Programming when refactoring PHP is invaluable and as such, this session will take a deep-dive into Polymorphism, SOLID principles and anti-patterns. After nailing down Object-Orientation, we’ll discuss how we can move legacy software architecture to suitable Design Patterns.
Extreme Programming practices will be presented as a key discussion point on how developers can help achieve these goals.
Design Principle and Design Pattern examples on C# .NET Core.
(Note: Not all the contents are original, I copied some of them from online tutorials while learning and found great explanations. A great thanks to all for this information.)
Learning solid principles using c#
S Single Responsibility Principle
O Open Closed Principle
L Liskovs Substitution Principle
I Interface Segregation Principle
D Dependency Inversion principle
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will assess how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
All 23 classical GOF Design Patterns with illustrations that try to catch some essence of them.
Used in a presentation for Eindhoven Developers, March 17, 2015 http://www.meetup.com/Eindhoven-Developers-Meetup/events/220477660/
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
Learning solid principles using c#
S Single Responsibility Principle
O Open Closed Principle
L Liskovs Substitution Principle
I Interface Segregation Principle
D Dependency Inversion principle
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will assess how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
All 23 classical GOF Design Patterns with illustrations that try to catch some essence of them.
Used in a presentation for Eindhoven Developers, March 17, 2015 http://www.meetup.com/Eindhoven-Developers-Meetup/events/220477660/
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
This paper briefly talks about SOLID design principles. It aims to discuss the implementation of IoC to invert dependencies. The paper explains Dependency Injection, its types and building IoC Containers in detail.
There are tons of awesome new tools produced by terrific companies and developers that get everyone excited about using their fancy new tool-set by essentially starting from scratch. This talk is not about using a fancy new framework and rewriting your entire application. As a developer who has spent the majority of his time working in legacy codebases where the first commits pre-date jQuery, it's hard not to get wrapped up in the "I want to rewrite the whole app with X" mentality. But in reality, time constraints or just the legacy framework you're building your apps with doesn't allow for that. Or, more realistically, it just needs to work and there is no business case for a rewrite. What this talk will show you how you can still enhance your front-end operation within an existing legacy codebase. I'll talk about first steps to modularizing a monolith, or simply taking a portion of a legacy app and modernizing it with a new toolset. This not only helps you as a developer to succeed with new tools, it makes you feel like you aren't being left behind in the modern world. Whether you're using legacy jQuery, or just some crammed together JavaScript, you shouldn't lose the ability to modernize your application, just because you can't buy in 100% to a modern framework.
Tips on how to break apart your monolithic JavaScript
Building an extension method to modularize your application
Creating backcompat methods for legacy code modernization
Using a modern framework for a portion of your app, and integrating that with your existing code.
Other considerations (minification, module loaders, tests, etc)
Yevhen Kalinichenko, Senior JavaScript Developer
“Object oriented concepts in real projects”
- Abstraction. What is it and what abstraction gives us
- Inheritance. Why do we need inheritance? Composition
over inheritance.
- Encapsulation. Why it’s so important to hide
implementation. Breaking of encapsulation leads us to
maintenance hell
- Polymorphism. Working with interface but not with
concrete implementation
- Single responsibility. Why “classes” must adhere single
responsibility
- Open/Closed principle
- Related topics – cohesion, coupling, interfaces,
separation of responsibilities for each team member.
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...kalichargn70th171
A dynamic process unfolds in the intricate realm of software development, dedicated to crafting and sustaining products that effortlessly address user needs. Amidst vital stages like market analysis and requirement assessments, the heart of software development lies in the meticulous creation and upkeep of source code. Code alterations are inherent, challenging code quality, particularly under stringent deadlines.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
24. Single responsibility principle
● Bad code example:
<?php
class InsurancePDFCreator {
// … some code
public function createPDFContents(Policy $policy);
public function downloadInsuranceCompanyLogos();
}
25. Single responsibility principle
● Good code example:
<?php
class InsurancePDFCreator {
// … some code
public function createPDFContents(Policy $policy);
}
// somewhere else
class InsuranceCompanyLogosDownloader {
public function download();
}
26. Conclusion
● Define your desired contexts carefully
● Make sure that there is only one responsibility for a
operation, class, method, module, etc.
● If you need to have a more abstract operations that
combine several stuff, find for them more abstract
names.
● And... Single Responsibility Principle is not
enough
30. Interface Segregation Principle
● Imagine this code:
<?php
class UsersManager {
public function createUser($username, $email);
public function deleteUserPicture($userId);
public function notifyUser($userId, $msg);
}
31. Interface Segregation Principle
It's bad because:
● It's provides a general-purpose interface
● When you include this class, you usually call one of
those methods
32. Interface Segregation Principle
The good way to do it:
● Use a set of client-specific classes (interfaces)
instead of one general-purpose interface
● Be more specific in your context
34. Conclusion
● Is extension to the Single Responsibility Principle
● Favored usage of client-specific interfaces, rather
then one general-purpose (mothership) interface
37. Open-Closed Principle
<?php
// somewhere else a naughty developer writes this:
class MyProductDiscountCalc extends ProductDiscountCalculator {
public function calculateDiscount(Product $product)
{
// Hardcoded discount here
return 300;
}
}
38. Open-Closed Principle
Why is this so bad?
● ProductDiscountCalculator is not an interface, but a
specific class
● We can push into usage it's replacement
● The code relies on ProductDiscountCalculator, but
it's children are changing the behavior and this is
bad
40. Open-Closed Principle
“But who is using specific types anyways? Can't we just use
interfaces?”
- Yes, that's why we should look at the next principles.
41. Open-Closed Principle
I bet you are puzzled now!
Don't be afraid, open-closed principle is used best
with his fellow brother the Liskov Substitution
principle!
42. Open-Closed Principle
● It bit better way to do it:
class MyProductDiscountCalc extends ProductDiscountCalculator {
public function myCalculateDiscount(Product $product)
{
// Hardcoded discount here
return 300;
}
}
45. Liskov Substitution Principle
Basically we must make sure that new derived
classes are extending the base classes without
changing their behavior. It's that easy.
48. Liskov Substitution Principle
Let's remember the previous example:
class ProductDiscountCalculator {
public function calculateDiscount(Product $product);
}
class MyProductDiscountCalculator ...
public function myCalculateDiscount(Product $product);
}
49. Liskov Substitution Principle
How do you know which is which?
<?php
if ($calc instanceof ProductDiscountCalculator) {
$calc->calculateDiscount($product);
}
if ($calc instanceof MyProductDiscountCalculator) {
$calc->myCalculateDiscount($product);
}
51. Liskov Substitution Principle
● One solution is to use abstract method:
<?php
abstract class AbstractDiscountCalc {
public function calculateDiscount(Product $product) {
return $this->getDiscountForProduct($product);
}
abstract protected function
getDiscountForProduct(Product $product);
}
52. Liskov Substitution Principle
<?php
class DefaultProductDiscountCalc extends AbstractDiscountCalc
{
protected function getDiscountForProduct(Product $product)
{
// our main algorithm for $discountRate
return $product->getPrice / $discountRate;
}
}
57. Dependency inversion principle
● So our previous example would use an interface:
<?php
interface DiscountCalculator {
public function calculateDiscount(Product $product);
}