You are on page 1of 5

Q1:

a) - Software architecture refers to the high level structures of a software system, the


discipline of creating such structures, and the documentation of these structures. These
structures are needed to reason about the software system. Each structure comprises
software elements, relations among them, and properties of both elements and relations.
[1]
 The architecture of a software system is a metaphor, analogous to the architecture of a
building
Link: https://en.wikipedia.org/wiki/Software_architecture

b)

Predictive methodologies Adaptive methodologies

Link: http://searchsoftwarequality.techtarget.com/tip/Waterfall-or-Agile-Differences-between-
predictive-and-adaptive-software-methodologies

c) - The basic characteristics of client/server architectures are:

+ Combination of a client or front-end portion that

interacts with the user,and a server or back-end portion

that interacts with the shared resource.

The client process contains solution-specific logic and

provides the interface between the user and the rest of the

application system. The server process acts as a software

engine that manages shared resources such as databases,

printers, modems, or high powered processors.

+ the front-end task and back-end task have fundamentally

different requirements for computing resources such as

processor speeds, memory, disk speeds and capacities, and

input/output devices.

+ the environment is typically heterogeneous and


multivendor. The hardware platform and operating system of

client and server are not usually the same.Client and

server processes communicate through a well-defined set of

standard application program interfaces (API's) and

RPC's.

+ An important characteristic of client-server systems is

scalability. They can be scaled horizontally or vertically.

Horizontal scaling means adding or removing client

workstations with only a slight performance impact.

Vertical scaling means migrating to a larger and faster

server machine or multiservers.

- How to build a client-server system using the Hypertext Transfer Protocol:

d)

Q2:

b)

c) - Dynamic binding is an object oriented programming concept and it is related with


polymorphism and inheritance.

- Binding of private, static and final methods always happen at compile time
since these methods cannot be overridden. When the method overriding is
actually happening and the reference of parent type is assigned to the
object of child class type then such binding is resolved during runtime.
- Difference between overloading a method name and overriding a method name that
that:
Overloading method Overriding method

- A feature that allows a class to - Declaring a method in sub class


have more than one method which is already present in
having the same name, if their parent class is known as
argument lists are different method overriding
- Three ways to - Overriding is done so that a
child class can give its own
overload a method implementation to a method
which is already provided by the
+ Number of parameters. parent class. In this case the
+ Data type of parameters. method in parent class is called
+ Sequence of Data type of overridden method and the
parameters. method in child class is called
overriding method
Using static binding Using dynamic binding

Q3:

a) - Explain why it is important to make mutable data members of a Java class private:

-> Otherwise other classes can modify your private implementation details and the
class that owns the member won't even know about it. This can break all your invariants, all
the guarantees you expect to hold true inside that class.
- No real way to get around the consequences except not to expose those members
in the first place. Make them private and make the type immutable. It's the only way
b) - Persistence, in computer science, is an adjective describing data that outlives the
process that created it.

- Object serialization is the Java language-specific mechanism for the storage and retrieval of
Java objects and primitives to streams
c)

Way 1:

Way 2:

d)
Shallow Copy Deep Copy

Cloned Object and original object are not 100% Cloned Object and original object are 100%
disjoint. disjoint.

Any changes made to cloned object will be Any changes made to cloned object will not be
reflected in original object or vice versa. reflected in original object or vice versa.

Default version of clone method creates the To create the deep copy of an object, you have to
shallow copy of an object. override clone method.

Shallow copy is preferred if an object has only Deep copy is preferred if an object has references
primitive fields. to other objects as fields.

Shallow copy is fast and also less expensive. Deep copy is slow and very expensive.

Deep copy of an object will have exact copy of all the fields of original object just like shallow copy. But
in additional, if original object has any references to other objects as fields, then copy of those objects
are also created by calling clone() method on them. That means clone object and original object will be
100% disjoint. They will be 100% independent of each other. Any changes made to clone object will not
be reflected in original object or vice-versa.

Q4:

Q5:

a)

You might also like