Wednesday 23 January 2013

Chapter 12: Design Elements




True-False Questions

1.      A component is a type of design class.

Answer:    False                Page Reference:  336                         Difficulty:  Moderate


2.      Two-tiered architectures usually combine data management and applications responsibilities into the same network layer.

Answer:    False                Page Reference:  338                         Difficulty:  Moderate


3.      Client-server applications usually involve the use of middleware.

Answer:    True                 Page Reference:  338                         Difficulty:  Moderate


4.      HTML and JavaScript are often used to represent business rules in a three-tier architecture.

Answer:    False                Page Reference:  339                         Difficulty:  Moderate


5.      Tight-coupling is an advantage of three-tiered architectures.

Answer:    False                Page Reference:  339                         Difficulty:  Moderate


6.      Architectures with more layers can support more scalability.

Answer:    True                 Page Reference:  339-340                  Difficulty:  Moderate


7.      A single analysis class almost invariably maps to multiple design classes.

Answer:    False                Page Reference:  340-341                  Difficulty:  Moderate


8.      Components are usually created by in-house staff for each application.

Answer:    False                Page Reference:  341                         Difficulty:  Moderate


9.      A package is a collection of classes.

Answer:    True                 Page Reference:  341                         Difficulty:  Moderate


10.  Third-party software components are usually well tested and relatively error free.

Answer:    True                 Page Reference:  341                         Difficulty:  Moderate


11.  The COM standard is developed and maintained by OMG.

Answer:    False                Page Reference:  342                         Difficulty:  Moderate


12.  CORBA is designed specifically to support software written in Java.

Answer:    False                Page Reference:  343                         Difficulty:  Moderate


13.  RMI is a middleware that enables the objects and methods of another Java program running on remote computers.

Answer:    True                 Page Reference:  344                         Difficulty:  Moderate


14.  The standard protocol for network transmissions on the internet is SMTP.

Answer:    False                Page Reference:  346                         Difficulty:  Moderate


15.  XML is superior to HTML for data interchange.

Answer:    True                 Page Reference:  346                         Difficulty:  Moderate


16.  XML documents are typically transported through the Internet by XML Schemas.

Answer:    False                Page Reference:  346-347                  Difficulty:  Moderate


17.  COM, ASP, and XML/SOAP are technologies incorporated into Microsoft’s .NET framework.

Answer:    True                 Page Reference:  347-348                  Difficulty:  Moderate


18.  Active X controls evolved from technologies related to dynamic link libraries.

Answer:    True                 Page Reference:  348                         Difficulty:  Moderate


19.  ASP .NET scripts execute via client browsers.

Answer:    False                Page Reference:  349                         Difficulty:  Moderate


20.  High cohesiveness is a desirable characteristic to strive for when creating packages.

Answer:    True                 Page Reference:  352                         Difficulty:  Moderate
21.  Tight coupling enhances the design quality of object-oriented software systems.

Answer:    False                Page Reference:  354                         Difficulty:  Moderate



Multiple-Choice Questions


22.  Design classes and ____________ are the two types of design elements.

a.       frameworks
b.      components
c.       packages
d.      tiers

Answer: b                         Page Reference:  336                         Difficulty:  Easy


23.  Which term refers to the process of designing applications that embrace change and integrate smoothly with internal and external processes?

a.       Application Change Development
b.      Business Process Reengineering
c.       Enterprise Application Design
d.      Application Change Management

Answer: c                          Page Reference:  337                         Difficulty:  Moderate


24.  An advantage of two-tiered architectures over three-tiered architectures is that two-tiered architectures:

a.       have thinner clients involving less need for upgrades.
b.      need no middleware in order to connect to databases.
c.       have less network traffic between client and database server.
d.      allow application changes to be tested in a few workstations.

Answer: d                         Page Reference:  339                         Difficulty:  Hard


25.  The middle tier of a three-tier architecture is primarily responsible for implementing:

a.       business rules.
b.      presentation logic.
c.       data access.
d.      network control.

Answer: a                          Page Reference:  339                         Difficulty:  Moderate

26.  Access to the functionality of software components is provided by well-defined:

a.       business rules.
b.      interfaces.
c.       public attributes.
d.      Web services.

Answer: b                         Page Reference:  341                         Difficulty:  Moderate

27.  ____________ are reusable objects that are distributed in binary form and support plug-and-play.

a.       Virtual machines
b.      Frameworks
c.       Packages
d.      Components

Answer: d                         Page Reference:  341                         Difficulty:  Moderate


28.  The Component Object Model (COM) is a software component standard developed by:

a.       OMG.
b.      Sun.
c.       Microsoft.
d.      ANSI.

Answer: c                          Page Reference:  342-343                  Difficulty:  Moderate


29.  The Object Management Group’s standard for distributed and heterogeneous networks of objects is called:

a.       JDBC.
b.      ActiveX.
c.       EJB.
d.      CORBA.

Answer: d                         Page Reference:  343                         Difficulty:  Moderate


30.  Remote Method Invocation (RMI) is a technology that allows:

a.       Java programs running on different machines to communicate with each other.
b.      designers to create components using UML models that automatically generate Java code.
c.       programs written in different programming languages to communicate with each other via an interface definition language.
d.      Web services to be sent between different applications via XML scripts.

Answer: a                          Page Reference:  344                         Difficulty:  Moderate
31.  Applet programs execute on:

a.       Web servers.
b.      application servers.
c.       client computers.
d.      mainframe hosts.

Answer: c                          Page Reference:  344                         Difficulty:  Moderate


32.  JBDC is a technology for connecting:

a.       a Java applet to a browser.
b.      a Java program to a database.
c.       a Java server page to a Web server.
d.      two Java programs together for network communications.

Answer: b             Page Reference:  344                                     Difficulty:  Moderate


33.  Which of the following is a language whose syntax is made up of tags similar to those interpreted by web browsers?

a.       IDL
b.      XML
c.       JavaScript
d.      CLR

Answer: b                         Page Reference:  346                         Difficulty:  Moderate


34.  Which of the following is a text-based transport protocol supporting B2B web services?

a.       HTTP
b.      SOAP
c.       COM
d.      ADO

Answer: b                         Page Reference:  346-347                  Difficulty:  Moderate



35.  Email exchanges over the Internet are governed by the ____________ protocol?

a.       FTP
b.      HTTP
c.       ASP
d.      SMTP

Answer: b                         Page Reference:  346-347                  Difficulty:  Moderate


36.  XML and SOAP are primarily used to develop:

a.       Web services
b.      client-side scripts
c.       binary components
d.      APIs.

Answer: a                          Page Reference:  347                         Difficulty:  Moderate


37.  The framework standard provided by Sun that competes with Microsoft’s .NET is called:

a.       OMG.
b.      CORBA.
c.       J2EE.
d.      SOAP.

Answer: c                          Page Reference:  347                         Difficulty:  Moderate


38.  A _____________ is a named description of a problem and solution that can be applied to new contexts.

a.       pattern
b.      signature
c.       servlet
d.      bean

Answer: a                          Page Reference:  353                         Difficulty:  Moderate


39.  When specifying responsibilities for design classes of a system, you should aim for:

a.       high coupling and high cohesion.
b.      high coupling and low cohesion.
c.       low coupling and high cohesion.
d.      low coupling and low cohesion.

Answer: c                          Page Reference:  354                         Difficulty:  Moderate


40.  In a UML design class diagram, a plus sign indicates:

a.       an input method argument.
b.      a constructor method.
c.       public attribute visibility.
d.      a mathematical operation.

Answer: c                          Page Reference:  354                         Difficulty:  Moderate


41.  Design classes extend analysis classes by adding all the following details EXCEPT:

a.       attribute data types.
b.      method arguments.
c.       visibility specifications.
d.      package collections.

Answer: d                         Page Reference:  353-357                  Difficulty:  Moderate


42.  Get methods are used for accessing data in ____________ attributes.

a.       public
b.      private
c.       derived
d.      composite

Answer: b                         Page Reference:  354                         Difficulty:  Moderate



Essay and Problem-Solving Questions


43.  Discuss the topic of layered architectures. How does this relate to object-orientation? Describe single-tier, two-tier, and three-tier architectures. Indicate how processing responsibilities are distributed in each architecture, and compare the advantages and disadvantages of each.

Answer:

In a layered architecture, a system is partitioned such that each layer performs a specific type of functionality and communicates with its adjoining layers. In this sense, the layers are like components with private implementations and providing public interfaces. The single-tier architecture is typified by a mainframe computer controlling presentation, business rules, and database access. This architecture is very inflexible and rare for new systems. Typically, only legacy mainframe-oriented systems and stand-alone PC programs use this architecture.  The two-tier architecture is much more common and is often called a client-server architecture. Typically, client-server architectures involve applications that run on the client computers, while the server computer controls the database and provides data access to the client applications. The interface is provided by middleware such as ODBC. Since both the application and presentation logic is performed on the client, this is called a thick client. Client-server architectures are sufficient for simple applications, but have limitations. Because the application logic runs on the client, this causes heavier demand on client computers and requires application changes to be distributed to a large number of client workstations. The three-tier architecture assigns only presentation logic to the client, often via the browser interpreting HTML or Javascript, leaving all business rule application logic to the middle tier of application servers, which are in turn connected to the data layer on a database server. This provides a loosely coupled system in which each layer’s internal changes don’t affect other layers as long as the interfaces remain the same. Because processing load is distributed across more layers, this architecture is more scalable than single-tier or two-tier architectures. Application changes only affect the middle layer computer, and don’t need to be distributed to many clients as in the client-server model. However, three-tier systems are more complex, require more interaction between different proprietary layers, and involve more sophisticated network demands.

                                          Page Reference:  337-340                  Difficulty:  Moderate



44.  What is middleware? How can use of middleware ease construction of database-driven applications? Name at least three middleware standards for database processing.

Answer:

Middleware is software that provides one set of interfaces for connection to a client and another set for connection to a server, thereby providing possibility of connections between one of several clients and one of several servers. Very frequently (although not always) application programs make use of one of the major middleware packages for their database processing needs. Microsoft has developed (and evolved) several database middleware technologies, including Open Database Connectivity (ODBC), OLE DB, and ActiveX Data Objects (ADO).  For Java-based applications, Sun provides JDBC.

                                          Page Reference:  338, 344-346, 348-349  Difficulty:  Moderate



45.  Discuss the process of mapping analysis classes to design elements. What types of transformations are there? What additional information is added to analysis class diagrams as they evolve into design class diagrams?

Answer:

An analysis class may map to a single design class, or be split into multiple design classes. Or, many analysis classes can map into a single design class, component, or package. Most entity classes map directly to design classes, whereas control classes often split into multiple design classes for modularity. Design classes are typically created in-house or available via a third party class library. Boundary classes are often mapped to, or use, components. Components are almost invariably third party products provided in binary form. Design classes inherit the attribute and method signatures from analysis classes, perhaps with some modifications. Attribute and method definitions are refined with data types and visibility constraints. Method definitions also include arguments.


                                          Page Reference:  340-341, 353-357   Difficulty:  Moderate



46.  What is a software component? Describe the roles components play in systems, their means of communication with other design elements, and other characteristics of components. What is the relationship between a component and a class? Between a component and an application?  How are components similar to and different from packages?

Answer:

A software component is a software element that with a well-defined interface and functionality used for a specific purpose in a plug-and-play manner by many applications. A component communicates to the outside world through the messages defined in its interface, often called an application programming interface (API). A single component may be made up of several classes and interfaces.  Components are generally provided by third-party vendors as binary code elements, using a variety of standards such as COM, ActiveX, Enterprise Java Beans, and CORBA. A single component may be used by a wide number of application programs. Components are similar to packages in that they both are collections of classes and interfaces. However, whereas components are used in a plug-and-play manner to provide functionality, packages are simply groupings of classes according to functionality, acting more as a library repository than a component of a system. Unlike components, packages do not, typically, have a single well-defined function and interface.


                                          Page Reference:  341-342, 352-353   Difficulty:  Moderate


47.  What is a transaction? What are the processing requirements in order to assure the integrity of a transaction? Which technologies and services are available to facilitate transaction processing in highly distributed, object-oriented systems?

Answer:

A transaction is an all-or-nothing unit of business work. This means that all of the computer operations that make up a transaction must be completed successfully. Thus, systems that support transactions should guarantee four properties: atomicity, consistency, isolation, and durability (ACID). Many products and standards include features supporting ACID. These include Microsoft’s .NET framework and COM model, based on Microsoft Transaction Services. Java’s EJB architecture, OMG’s CORBA, and XML/SOAP standards all provide transaction management for distributed systems.  

                                          Page Reference:  343, other pages      Difficulty:  Moderate


48.  Identify, describe and compare three leading binary-oriented component standards. For each standard cited, identify the organization responsible for the standard, and discuss some of the underlying technology and design elements. What are some of the limitations of these standards?

Answer:

The three leading binary-oriented component standards are Microsoft’s Component Object Model (COM), the Object Management Group’s (OMG) Common Object Request Broker Architecture (CORBA), and Sun’s Enterprise Java Beans (EJB). COM is the basic architecture that underlies most of Microsoft’s .NET framework, and has extended into COM+, which includes a run-time environment for middle-tier components and support for many Microsoft Transaction Server functions. In addition, DCOM is distributed COM, providing features for remote procedure calls in distributed systems. Components built using the COM architecture run effectively in Microsoft’s IIS Web Server and are frequently used in ASP scripts. COM objects do not, however, work well in non-Microsoft platforms.

The CORBA standard was published by the Object Management Group, a non-profit consortium that produces and maintains specifications for interoperable enterprise applications. It was designed to allow distributed objects, operating on heterogeneous networks, to interact with each other seamlessly. Communication is managed by an Object Request Broker (ORB), which directs requests from CORBA clients to CORBA servers. Thus method invocation by the client does not require knowledge of the location of services. Applications request the service, and the ORB finds the server that provides the service. CORBA’s advantage is that heterogeneous platforms can interact with each other. A site with legacy COBOL applications on a mainframe can interact with a client-server Linux system, using ORBs and a layer written in Interface Definition Language (IDL).

Sun’s EJB is written in Java and executes on any machine running a Java Virtual Machine (JVM). It is a server-side component model addressing issues involving management of distributed objects in a multi-tier architecture. The EJB standard imposes naming conventions and other design rules to construction of Java classes. Any Java class can be an Enterprise Java Bean if it is designed according to these rules. EJB components can be invoked using Java’s Remove Method Invocation (RMI).

 Although each of these standards has its strengths, all suffer from common limitations. They are proprietary and binary, tightly coupled, and lock their data transfer on underlying network and object infrastructures. None support the TCP/IP protocol, but instead all rely on other interfaced layers (often via XML and SOAP) to work in TCP/IP environments.


                                          Page Reference:  342-346                  Difficulty:  Moderate


49.  How do XML and SOAP assist with business-to-business commerce? What is XML, and what role does it play? What are the similarities and differences between XML and HTML? What is SOAP, and what role does it play? Finally, what are Web services, and how are they related to XML and SOAP?

Answer:


Extensible Markup Language (XML) is a method for representing structured data in a text file to facilitate data communication between computer applications via the Internet. XML’s syntax, composed of tags and attributes, is similar to HTML. But whereas HTML is limited with presentation functionality, XML is primarily a structured data representation. Data is defined in XML Schemas or Document Type Definitions. Simple Object Access Protocol (SOAP) is a protocol for text-based representation of message passing between systems. SOAP messages include an envelope, header, and body section. The body section typically contains XML formatted data pertaining to the message. Web services, a process and set of protocols for discovering software as services across the Web. Specifically, Web services can  use a data protocol like XML and a transport protocol like SOAP as a foundation for  providing a standardized loose coupling for B2B transactions.

                                          Page Reference:  346-347                  Difficulty:  Moderate



50.  What is a framework? Identify and discuss two major application development frameworks. Give names and descriptions of the technologies, programming languages, and component protocols that underlie each of these frameworks. For each framework, identify the technologies that support program compilation and execution, database connectivity, and dynamic Web page creation.

Answer:

A framework is a collection of components, including code and interfaces written in a specific language, that solves or helps build applications. It provides the underlying services required for developing and executing applications. Two major frameworks in the IT industry are Microsoft’s .NET framework and Sun’s Java2 Enterprise Edition (J2EE). The .NET framework integrates components built using the extended Component Object Model (COM+) protocol, utilizing Active Server Pages (ASP .NET) for dynamic Web page construction, and ActiveX Data Objects (ADO .NET) as the middleware for connecting applications to databases. Applications written for .NET are typically coded, via the Visual Studio .NET development environment, in Visual Basic, Visual C++, or C# and are compiled into Microsoft Intermediate Language (MSIL), which enable them to be executed by the Common Language Runtime (CLR) environment. Sun’s J2EE comprises a standard for enterprise-wide application development and execution. Obviously, the main programming language used in J2EE is Java. J2EE’s components are based on JavaBeans technology, most database connectivity is implemented using JDBC middleware. The Java Development Kit (JDK) provides a library of classes grouped into packages. Servlets and Java Server Pages (JSP) support dynamic Web page creation. Applications are compiled into bytecode and interpreted by the Java Virtual Machine.


                                          Page Reference:  347-349                  Difficulty:  Moderate


51.  What is a responsibility? How are responsibilities represented in sequence and class diagrams? Discuss three guidelines that can help ensure proper allocation of responsibilities when mapping analysis classes to design classes. 

Answer:

Responsibilities form the behaviors assigned to an analysis class based on its interface to outside classes. A responsibility is represented by a message in a sequence diagram, and is shown as a method in an analysis class. Responsibilities should be assigned to classes with three guidelines in mind. First, behaviors should be performed by the information expert, that is, by the class containing the information required for the behavior. Second, creation of an object should be the responsibility of the classes that aggregate, contain, or closely use the class of that object. Third, distribution of responsibility should result in loose coupling and strong cohesion.

                                          Page Reference:  353-354                  Difficulty:  Moderate



52.  In terms of design class creation, what is visibility?   What are three different types of visibility? Which rules of thumb should be used when assigning visibility to ensure object encapsulation? How can access to attribute values be controlled?

Answer:

Visibility refers to the characteristics of an attribute or operation that reveal whether it can be accessed directly. There are three types of visibility, each of which can be applied to any attribute or operation of a class. Public visibility means that any object external to the class can access the attribute’s values or invoke the operation. With private visibility, only other operations within the class can access the attribute or operation. With protected visibility, operations from the class or its descendent classes can access the attribute or operation. The principle of encapsulation implies that attributes should be held private, and that controlled access to private attribute values can be provided using public get- and set- methods.

                                          Page Reference:  354-355                  Difficulty:  Moderate




No comments:

Post a Comment