Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

Features

Struts Tutorials
*Stuts TOC
*Apache Struts Introduction
* Struts Controller
* Struts Action Class
* Struts ActionFrom Class
* Using Struts HTML Tags
*Struts Validator Framework    
*Client Side Address Validation    
*Struts Tiles
*tiles-defs.xml
*Struts DynaActionForm
*Struts File Upload
*Struts DataSource
*AGGREGATING ACTIONS
*Internationalization
Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Design patterns interview questions1

                         

Q1. What are design patterns?

Ans. A pattern is a proven (and recurring) solution to a problem in a context. Each pattern describes a problem which occurs over and over again in our environment, and describes its solution to this problem in such a way that we can use this solution a lots of times. In simple words, there are a lot of common problems which a lot of developers have faced over time. These common problems ideally should have a common solution too. It is this solution when documented and used over and over becomes a design pattern.

Q2. Can we always apply the same solution to different problems at hand?

Ans. No. Design patterns would study the different problems at hand. To these problems then it would suggest different design patterns to be used. However, the type of code to be written in that design pattern is solely the discretion of the Project Manager who is handling that project.

Q3.What should be the level of detail/abstraction which should be provided by a design pattern?

Ans.
Design patterns should present a higher abstraction level though it might include details of the solution. However, these details are lower abstractions and are called strategies. There may be more than one way to apply these strategies in implementing the patterns.

Q4. What are the most common problems which one faces during the application design phase that are solved by design patterns?

Ans.
These are:

  • Identifying components, internal structures of the components, and relationships between components.
  • Determining component granularity and appropriate interactions
  • Defining component interfaces.

Q5. How does one decide which Design pattern to use in our application?

Ans.
We need to follow these steps:

  1. We need to understand the problem at hand. Break it down to finer grained problems. Each design pattern is meant to solve certain kinds of problems. This would narrow down our search for design patterns.
  2. Read the problem statement again along with the solution which the design pattern will provide. This may instigate to change a few patterns that we are to use.
  3. Now figure out the interrelations between different patterns. Also decide what all patterns will remain stable in the application and what all need to change (with respect to Change Requests received from the clients).

Q6. What is Refactoring?

Ans. Learning different design patterns is not sufficient to becoming a good designer. We have to understand these patterns and use them where they have more benefits. Using too many patterns (more than required) would be over-engineering and using less design patterns than required would be under-engineering. In both these scenarios we use refactoring. Refactoring is a change made to the internal structure of the software to make it easier to understand and cheaper to modify, without changing its observable behaviour.

Q7. What are Antipatterns?

Ans. Though the use of patterns fulfils our objectives in the applications; there are also several instances where several applications did not fulfill their goals. The architects of these applications too need to document these wrong decisions. This helps us in repeating these mistakes in our future applications. Such documented mistakes are called antipatterns.

Thus antipatterns are negative solutions which cause more problems than what they address. For ex. We might use entity beans which have fine-grained interfaces which can directly be accessed from the client side. This would result in considerable RMI and transaction management overhead. It results in poor performance and un-scalable applications.

SPECIFIC PATTERNS

Q8. As we do development in tiers, how do we divide patterns in tiers?

Ans. The Sun Java Center has classified the patterns in three tiers. These are:

  1. Presentation tier patterns for web-component tier,
  2. Business tier patterns for business logic (EJB) tier, and
  3. Integration tier patterns for connection to the databases.

The presentation tier patterns are:

Intercepting filter, Front Controller, View Helper, Composite View, Service-to-Worker, and Dispatcher View.

The business tier patterns are:

Business delegate, Value Object, Session Façade, Composite Entity, Value Object Assembler, Value List Handler, and Service Locator.

Integration tier patterns are:

Data Access Object (DAO) and Service Activator.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

Nice Explnation

Posted by Rama on Thursday, 09.6.07 @ 15:56pm | #25286

Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.