Page 1 of 9. DP 2 Marks. www.creativestellars.blogspot.In. Design Patterns- 2 marks. 1.Distinguish a class and an object
DP 2 Marks
Design Patterns- 2 marks 1.Distinguish a class and an object Definition
Existence Memory Allocation Declaration/definition
Class Class is mechanism of binding data members and associated methods in a single unit. It is logical existence Memory space is not allocated , when it is created. Definition is created once.
Object Instance of class or variable of class. It is physical existence Memory space is allocated, when it is created. it is created many time as you require.
2.Stekch MVC architecture MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns.
www.creativestellars.blogspot.In
DP 2 Marks
3. Give the meaning of “WYSIWYG” Use when you want to give the user a clear indication of what their content will look like when it is published. WYSIWYG is an acronym for What You See Is What You Get. Use when the users of a site are not comfortable with formatting text using HTML codes or a markup language such as textile or markdown.
4.Define an Iterator class. Iterator pattern is very commonly used design pattern in Java and .Net programming environment. This pattern is used to get a way to access the elements of a collection object in sequential manner without any need to know its underlying representation. Iterator pattern falls under behavioral pattern category.
5.Define Intent Intent A short statement that answers the following questions: What does the design pattern do? What is its rationale and intent? What particular design issue or problem does it address?
6.Smalltalk MVC. The Model/View/Controller (MVC) triad of classes is used to build user interfaces in Smalltalk-80. MVC consists of three kinds of objects. The Model is the application object; the View is its screen presentation, and the Controller defines the way the user interface reacts to user input. MVC decouples them to increase flexibility and reuse. MVC decouples views and models by establishing a subscribe/notify protocol between them. A view must ensure that its appearance reflects the state of the model. Whenever the model's data changes, the model notifies views that depend on it. In response, each view gets an opportunity to update itself. This approach lets you attach multiple views to a model to provide different presentations. You can also create new views for a model without rewriting it. The following diagram shows a model and three views. The model contains some data values, and the views defining a spreadsheet, histogram, and pie chart display these data in various ways. The model communicates with its views when its values change, and the views communicate with the model to access these values.
www.creativestellars.blogspot.In
DP 2 Marks
7. Design Pattern. A design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Usage: Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.
8.Define Inheritance. In object-oriented programming, inheritance is the concept that when a class of objects is defined, any subclass that is defined can inherit the definitions of one or more general classes. This means for the programmer that an object in a subclass need not carry its own definition of data and methods that are generic to the class (or classes) of which it is a part. This not only speeds up program development; it also ensures an inherent validity to the defined subclass object (what works and is consistent about the class will also work for the subclass).
www.creativestellars.blogspot.In
DP 2 Marks
9.What are Creational Patterns creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or in added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
10.Define Abstraction & Data Abstraction. Abstraction is the act of representing essential features without including the background details or explanations. In the computer science and software engineering domain, the abstraction principle is used to reduce complexity and allow efficient design and implementation of complex software systems. Data abstraction refers to providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details. (Or) Data abstraction is the reduction of a particular body of data to a simplified representation of the whole. Abstraction, in general, is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics. As in abstract art, the representation is likely to be one potential abstraction of a number of possibilities. A database abstraction layer, for example, is one of a number of such possibilities.
11. Draw the structure of the builder. Builder pattern builds a complex object using simple objects and using a step by step approach. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object. A Builder class builds the final object step by step. This builder is independent of other objects.
www.creativestellars.blogspot.In
DP 2 Marks
12. What is encapsulation? Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding.
13. What is the intent of Bridge?
Defines an instance for creating an object but letting subclasses decide which class to instantiate Refers to the newly created object through a common interface
www.creativestellars.blogspot.In
DP 2 Marks
14. Give the benefits on Abstract classes? Abstract classes are used to organize programs. The same program could be organized in many ways. Our example program could be written without an abstract class. But a real-world application might have hundreds of classes. Grouping classes together is important in keeping a program organized and understandable. The advantage of using an abstract class is that you can group several related classes together as siblings.
15. Differentiate white box and black box reuse.
www.creativestellars.blogspot.In
DP 2 Marks
16. Using which criteria patterns are classified?
17. Explain motivation of Singleton. Sometimes it's important to have only one instance for a class. For example, in a system there should be only one window manager (or only a file system or only a print spooler). Usually singletons are used for centralized management of internal or external resources and they provide a global point of access to themselves. The singleton pattern is one of the simplest design patterns: it involves only one class which is responsible to instantiate itself, to make sure it creates not more than one instance; in the same time it provides a global point of access to that instance. In this case the same instance can be used from everywhere, being impossible to invoke directly the constructor each time. 18. List the Structural patterns. Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities. Adapter Match interfaces of different classes
www.creativestellars.blogspot.In
DP 2 Marks
Bridge Separates an object's interface from its implementation Composite A tree structure of simple and composite objects Decorator Add responsibilities to objects dynamically Facade A single class that represents an entire subsystem Flyweight A fine-grained instance used for efficient sharing Private Class Data Restricts accessor/mutator access Proxy An object representing another object
19.Differentiate compositor and composition.
www.creativestellars.blogspot.In
DP 2 Marks
20.What is MVC? The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.
www.creativestellars.blogspot.In