Documente Academic
Documente Profesional
Documente Cultură
ANSWER:
Association:
2. Associations are bi-directional i-e both classes are involved in a relationship or uni-
directional.
Example:
1. Bi-directional association
The bi-directional association relationship is shown by a line between two classes with a
name of relationship on the line as shown below:
Now the diagram above reflects the basic type of association that exists between Staff
member and Campaign class and it is a representation of bi-directional association
between participating classes. Both classes are aware of this relationship among them.
2. Uni-Directional:
unknown class. In the diagram below PersonName class know about Telephone# class
but not the other way around.
QUESTION: JAVA CODE OF SHAPE, CIRCLE, RECTANGLE WITH
POLYMORPHISM IN WRITTEN FORM.
ANSWER:
ANSWER:
ANSWER:
Coupling is a qualitative indication of the degree to which a module is connected to
other modules and to the outside world In other words, coupling is a measure of
interconnection among modules in a software structure. Loose coupling is better.
Simple connectivity is easier to understand and less prone to “ripple effect”
Type of Coupling
Indirect coupling occurs when one object interacts with another object through a third
component, usually a controller. Another form of indirect coupling occurs when using a
data-driven style of computation
Data coupling occurs when a portion of a data structure is passed among modules.
When using data coupling, shorter parameter lists are preferred to longer ones
Stamp coupling occurs when a portion of data structure is passed among modules.
When using stamp coupling, a smaller number of actual arguments are preferable to a
larger number because the only data that should be passed to a module is what it
requires
Control coupling occurs when information is passed to a module that affects its
internal control. This is undesirable because it requires the calling module to know the
internal operation of the module being called
External coupling occurs when a module depends on the external environment
Common coupling occurs when modules access common areas of global or shared
data. This form of coupling can cause one module to unintentionally interfere with the
operation of another module
Content coupling occurs when one module uses information contained in another
module
ANSWER:
How can we create designs that are stable in the face of change and that will last longer
than the first version?
Bertrand Meyer gave us guidance as long ago as 1988 when he coined the now famous
open-closed principle. To paraphrase him:
“Software entities like classes, modules and functions should be open for
extension but closed for modifications”
Meyer’s used inheritance to solve the apparent dilemma of the principle. His idea was
that once completed, the implementation of a class could only be modified to correct
errors, but new or changed features would require that a different class be created.
When a single change to a program results in a cascade of changes to dependent
modules, that program exhibits the undesirable attributes that we have come to
associate with “bad” design. The program becomes fragile, rigid, unpredictable and un-
reusable. The open closed principle attacks this in a very straightforward way. It says
that you should design modules that never change. When requirements change, you
extend the behavior of such modules by adding new code, not by changing old code
that already works.
Modules that conform to the open-closed principle have two primary attributes:
It would seem that these two attributes are at odds with each other. The normal way to
extend the behavior of a module is to make changes to that module. A module that
cannot be changed is normally thought to have a fixed behavior. How can these two
opposing attributes be resolved?
ANSWER:
Cohesion is the qualitative indication of the degree to which a module focuses on just
one thing
In other words, cohesion is a measure of the relative functional strength of a
module
A cohesive module performs one single task or is focused on one thing
Highly cohesive modules are better; however, mid-range cohesion is acceptable
Low-end cohesion is very bad
Types of Cohesion
Coincidental cohesion occurs when unrelated components of a system are bundled
together
Logical cohesion occurs when components performing similar functions are put
together (e.g., error handling)
Temporal cohesion occurs when components that are activated at a single time or time
span are put together
Procedural cohesion occurs when the elements in a component form a single control
sequence
Communicational cohesion occurs when all elements of a component operate on the
same input data, produce the same output data, or operate on one area of a data
structure
Sequential cohesion occurs when the output of one element in a component serves an
input for another element
Functional cohesion occurs when each part of a component is necessary for the
execution
of a single function
Object cohesion occurs when the functions of a common class of objects are
aggregated with the class. In this scheme, interfaces are specified to reveal as little as
possible about the inner workings of the object
ANSWER:
In software engineering, a class diagram in the Unified Modeling Language (UML) is a
type of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, operations (or methods), and the relationships among
objects.
QUESTION:
Extend
Generalization
ANSWER:
Control Coupling.
Ali Drives
Car
JUSTIFY OCP?
ANSWE
R:
QUESTION: A character has four types which are letter, punctual sign, Special
characters and numbers. All these types have common attribute. Draw a class
diagram.
Answer:
ANSWER:
Extreme Programming encourages starting with the simplest solution. Extra functionality
can then be added later. The difference between this approach and more conventional
system development methods is the focus on designing and coding for the needs of
today instead of those of tomorrow, next week, or next month. Coding and designing for
uncertain future requirements implies the risk of spending resources on something that
might not be needed. Related to the "communication" value, simplicity in design and
coding should improve the quality of communication. A simple design with very simple
code could be easily understood by most programmers in the team.
QUESTION: WRITE 2 USER STORIES IN CONTEXT OF XP OF LMS OF VIRTUAL
UNIVERSITY?
ANSWER:
We can write about functionality of QUIZ and ASSIGNMENT in it.
ANSWER:
ANSWER:
i. Static
a. Use case diagram
b. Class diagram
ii. Dynamic
a. Activity diagram
b. Sequence diagram
c. Object diagram
d. State diagram
e. Collaboration diagram
This model divides the life cycle of a software development process into the phases as
shown in the figure.
This model is just like the one-way street. Once phase X is completed and next phase Y
has started then there is no way to going back on the previous phase. Then if the
project fails then we have to repeat all the process and steps which consumes too much
time and it takes too much cost for it. This is the issues to the failure of the waterfall
model in term of cost and time.
QUESTION: AN AUTOMATED TICKET ISSUING SYSTEM IS USED BY
PASSENGERS AT A RAILWAY STATION FOR MULTIPLE PURPOSES. THE
SYSTEM SHOULD ALSO ALLOW RESERVATION OF SEATS AND GIVE SOME
ROUTE INFORMATION.
THE PASSENGER SHOULD BE ABLE TO PAY FOR THE TICKET AT THE
COUNTER ALSO.
ANSWER:
QUESTION: WHERE ORDER IS PLACED AND IT CONTAIN DIFFERENT ORDER
ITEMS (ORDER DETAILS), EACH ORDER DETAIL IS HAVING PRODUCT BUT
EVERY PRODUCT WILL NOT BE A PART OF ORDER ITEM BUT FOR ORDER ITEM
TO EXIST IT SHOULD HAVE AN ORDER FOR IT. SO THE RELATIONSHIP
BETWEEN ORDER AND ORDER ITEM IS OF COMPOSITION BUT BETWEEN
ORDER ITEM AND PRODUCT IS AGGREGATION.
ANSWER:
ANSWER:
Company, student, subject ,institute all these are objects.
ANSWER:
Document Category
1 have 1-*
College Departments
1 have 1-*
ANSWER:
Company
Department Employees
Permanent
Contract
Employee
Employee
QUESTION: WRITE AND DESCRIBE AT LEAST 4 MILES STONE OF VULMS USING
RUP?
ANSWER:
1. Lifecycle objectives.
2. Lifecycle architecture.
3. Initial operational capability.
4. Product release.
QUESTION: DRAW A DIAGRAM OF BOTTOM-UP.
ANSWER:
ANSWER:
Functionality.
Reliability.
Usability.
Efficiency.
Maintainability.
Portability.
Cost
QUESTION: TOP-DOWN TECHNIQUE WITH DIAGRAM.
ANSWER:
Top-down: we have a class, and we realize that we need to break it down into
subclasses which have different attributes and operations.
From the class diagram below it seems that there is no need to break the
advertisements (Advert) but when we perform a analysis then we find out that there are
multiple types of adverts each having its own properties methods and here we find out
2nd level of inheritance between Press Advert is having 2 child which i-e Press advert;
is a child by itself.
ANSWER:
Polymorphism
The dictionary definition of polymorphism refers to a principle in biology in which an
organism or species can have many different forms or stages. This principle can also be
applied to object-oriented programming and languages like the Java language.
Subclasses of a class can define their own unique behaviors and yet share some of the
same functionality of the parent class.
Polymorphism can be demonstrated with a minor modification to the Bicycle class. For
example,
printDescription method could be added to the class that displays all the data currently
stored in
an instance.
public void printDescription(){
System.out.println("\nBike is in gear " + this.gear + " with a cadence of " +
this.cadence + " and
travelling at a speed of " + this.speed + ". ");
}
To demonstrate polymorphic features in the Java language, extend the Bicycle class
with
a MountainBike and aRoadBike class. For MountainBike, add a field for suspension,
which is
a String value that indicates if the bike has a front shock absorber, Front. Or, the bike
has a front
and back shock absorber, Dual.
Here is the updated class:
public class MountainBike extends Bicycle{
private String suspension;
super.printDescription();
}}
Note that once again, the printDescription method has been overridden. This time,
information about the tire width is displayed. To summarize, there are three
Here is a test program that creates three Bicycle variables. Each variable is assigned to
one of
bike01.printDescription();
bike02.printDescription();
bike03.printDescription();
}}