Enterprise Java Design Patterns

Access: Public Instant Grading

Start FlashCards Download PDF Quiz Series Learn

Get the best Software engineering course in your pocket!

The objective of this session is to introduce the subject of software engineering. When you have read this session you will understand what software engineering is and why it is important, know the answers to key questions which provide an introduction to software engineering, understand ethical and professional issues which are important for software engineers.

Introduction

Virtually all countries now depend on complex computer-based systems. More and more products incorporate computers and controlling software in some form. The software in these systems represents a large and increasing proportion of the total system costs. Therefore, producing software in a cost-effective way is essential for the functioning of national and international economies.

Software engineering is an engineering discipline whose goal is the cost-effective development of software systems. Software is abstract and intangible. It is not constrained by materials, governed by physical laws or by manufacturing processes. In some ways, this simplifies software engineering as there are no physical limitations on the potential of software. In other ways, however, this lack of natural constraints means that software can easily become extremely complex and hence very difficult to understand.

Software engineering is still a relatively young discipline. The notion of ‘software engineering’ was first proposed in 1968 at a conference held to discuss what was then called the ‘software crisis’. This software crisis resulted directly from the introduction of powerful, third generation computer hardware. Their power made hitherto unrealisable computer applications a feasible proposition. The resulting software was orders of magnitude larger and more complex than previous software systems.

Early experience in building these systems showed that an informal approach to software development was not good enough. Major projects were sometimes years late. They cost much more than originally predicted, were unreliable, difficult to maintain and performed poorly. Software development was in crisis. Hardware costs were tumbling whilst software costs were rising rapidly. New techniques and methods were needed to control the complexity inherent in large software systems.

These techniques have become part of software engineering and are now widely although not universally used. However, there are still problems in producing complex software which meets user expectations, is delivered on time and to budget. Many software projects still have problems and this has led to some commentators (Pressman, 1997) suggesting that software engineering is in a state of chronic affliction.

As our ability to produce software has increased so too has the complexity of the software systems required. New technologies resulting from the convergence of computers and communication systems place new demands on software engineers. For this reason and because many companies do not apply software engineering techniques effectively, we still have problems. Things are not as bad as the doomsayers suggest but there is clearly room for improvement.


Quiz PDF eBook: 
Enterprise Java Design Patterns
Download EJDP Quiz PDF eBook
20 Pages
2010
English US
Educational Materials



Sample Questions from the Enterprise Java Design Patterns Quiz

Question: You would like to raise the security level of your system by examining incoming HTTP requests. You would like to log information about each request and to filter requests with malicious scripts. Where would you put such request processing code?

Choices:

in the Service Locator

in the Service Activator

in the Intercepting Filter

in the View Helper

Question: Your application's performance is affected due to the significant number of remote calls to your business logic. The business logic is exposed as fine grained methods to the clients. Which refactoring can be done to improve the application's performance?

Choices:

Add a Front Controller to centralize requests processing

Implement a Session Facade, which provides a coarse grained service-oriented interface to clients

Move the frequently called business logic to the presentation tier

Encapsulate multiple business data attributes into smaller set of serializable transfer objects, to reduce remote invocations

Question: you are in charge of developing an e-commerce web application, the client expects high traffic volumes and the security is of essence. Which user session management strategy would you choose?

Choices:

Save user session in http cookies

Save user session in html hidden fields

Save user session in an HttpSession object

Save user session in an EJB stateful session bean object

Question: You application's performance is affected due to repeated JNDI lookups done by every client accessing your application. Which pattern is most appropriate to improve the performance and solve the problem?

Choices:

Service Locator

Session Facade

Business Delegate

Transfer Object

Question: Your job is to refactor an application ,which uses JSP technology as a View. The JSP pages are dominated by scriptlet code. Which pattern would be appropriate to solve this problem?

Choices:

View Helper

Composite View

Data Access Object

Context Object

Question: Your Parcel delivery company is expanding it's existing web application. Currently the clients can track their parcels using web browsers, and your company wants to expose it's business to it's partners as web-services. However; when you inspected the code base, you discovered that the application passes HttpServletRequest parameters to the business tier for further processing. Your job is to refactor this existing code base to avoid duplicating the business logic to handle the two request channels (http and web service requests). Which refactoring is appropriate for this case without code duplication?

Choices:

Use front controller pattern

Use context object pattern

Use proxy pattern

Use service broker pattern

Question: How to secure you web application against security risks such as cross site scripting (css) and SQL injection in a centralized manner that avoids code duplicate and ensures that every HTTP request would be inspected?

Choices:

use Intercepting Filter pattern

use Front Controller pattern

use Composite View pattern

use Business Delegate pattern

Question: Which of the following patterns would you use to transfer certain state to the next tier without passing on protocol-specific system information?

Choices:

Transfer Object

Context Object

Context Filter

Service To Worker

Question: A service locator is best implemented as a Singleton.

Choices:

true

false

Question: In your web application you decided to use Javascript to validate each user input on the client browser. Where do you need to duplicate the validation code on the server?

Choices:

No double check on the server side is needed as the input is already checked on the client side

double check in the presentation tier

double check in the integration tier

double check in the business tier

Question: What is TRUE about the Updatable Transfer Objects Strategy?

Choices:

It is used when the client needs not only to read the business component attributes but also to be able to modify them

It reduces the complexity of the system in terms of update propagation and synchronization

It adds on complexity to the system in terms of update propagation and synchronization

Transfer Objects in general can reduce network overhead

Start FlashCards Download PDF Quiz Series Learn