The document discusses JavaScript design patterns as reusable solutions for common software design problems, emphasizing their advantages such as proven techniques, reusability, and expressiveness. It outlines the structure and essential components of a design pattern, including context, problem statement, solution, and implementation. The document highlights the importance of design patterns in promoting effective communication among developers and improving software development processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views10 pages
2.15 JavaScript Design Pattern
The document discusses JavaScript design patterns as reusable solutions for common software design problems, emphasizing their advantages such as proven techniques, reusability, and expressiveness. It outlines the structure and essential components of a design pattern, including context, problem statement, solution, and implementation. The document highlights the importance of design patterns in promoting effective communication among developers and improving software development processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10
PHP & JS FRAMEWORK
20CSI504-PHP & JS FRAMEWORK
MODULE : II
MODULE NAME : JAVASCRIPT FUNDAMENTALS
TOPIC : JAVASCRIPT DESIGN PATTERNS
FACULTY : DR. S. KARTHIKEYINI, AP/M.TECH CSE
JAVASCRIPT DESIGN PATTERNS
▣ A pattern is a reusable solution that can be
applied to commonly occurring problems in software design - in our case - in writing JavaScript web applications. Another way of looking at patterns are as templates for how we solve problems - ones which can be used in quite a few different situations. ADVANTAGE ▣ Patterns are proven solutions: They provide solid approaches to solving issues in software development using proven techniques that reflect the experience and insights the developers that helped define them bring to the pattern. ▣ Patterns can be easily reused: A pattern usually reflects an out of the box solution that can be adapted to suit our own needs. This feature makes them quite robust. ▣ Patterns can be expressive: When we look at a pattern there’s generally a set structure and vocabulary to the solution presented that can help express rather large solutions quite elegantly. ADVANTAGE
▣ Patterns are not an exact solution. It’s
important that we remember the role of a pattern is merely to provide us with a solution scheme. Patterns don’t solve all design problems nor do they replace good software designers, however, they do support them. ADVANTAGE
▣ Reusing patterns assists in preventing minor
issues that can cause major problems in the application development process. ▣ Patterns can provide generalized solutions which are documented in a fashion that doesn't require them to be tied to a specific problem. ▣ Certain patterns can actually decrease the overall file-size footprint of our code by avoiding repetition. ADVANTAGE
▣ Patterns add to a developer's
vocabulary, which makes communication faster. ▣ Patterns that are frequently used can be improved over time by harnessing the collective experiences other developers using those patterns contribute back to the design pattern community. STRUCTURE OF A DESIGN PATTERN ▣ You may be curious about how a pattern author might approach outlining structure, implementation and purpose of a new pattern. A pattern is initially presented in the form of a rule that establishes a relationship between: ▣ A context ▣ A system of forces that arises in that context and ▣ A configuration that allows these forces to resolve themselves in context DESIGN PATTERN SHOULD HAVE ▣ Pattern name and a description ▣ Context outline – the contexts in which the pattern is effective in responding to the users needs. ▣ Problem statement – a statement of the problem being addressed so we can understand the intent of the pattern. ▣ Solution – a description of how the user’s problem is being solved in an understandable list of steps and perceptions. ▣ Design – a description of the pattern’s design and in particular, the user’s behavior in interacting with it ▣ Implementation – a guide to how the pattern would be implemented ▣ Illustrations – a visual representation of classes in the pattern (e.g. a diagram) ▣ Examples – an implementation of the pattern in a minimal form ▣ Co-requisites – what other patterns may be needed to support use of the pattern being described? ▣ Relations – what patterns does this pattern resemble? does it closely mimic any others? ▣ Known usage – is the pattern being used in the wild? If so, where and how? ▣ Discussions – the team or author’s thoughts on the exciting benefits of the pattern DESIGN PATTERNS
▣ Design patterns are quite a powerful approach to
getting all of the developers in an organization or team on the same page when creating or maintaining solutions. If considering working on a pattern of your own, remember that although they may have a heavy initial cost in the planning and write-up phases, the value returned from that investment can be quite worth it. Always research thoroughly before working on new patterns however, as you may find it more beneficial to use or build on top of existing proven patterns than starting afresh. 10