Showing posts with label Software Engineering. Show all posts
Showing posts with label Software Engineering. Show all posts

Thursday, December 31, 2009

Coupling and Cohesion

Time spent on software design process takes the most significant part of the software development life cycle. Taken design decision affects the whole product positively or negatively so at this point, coupling and cohesion come into play.
Coupling is defined as a measure of intermodule connectivity. There are different forms of coupling such as data,stamp,control and common-environment coupling.
Cohesion helps to determine how functionally the intramodule components are related. Principal forms of cohesion are listed as functional, sequential, communicational, procedural, temporal, logical and coincidental.
General design approach includes generating highly cohesive and loosely coupled modules. Highly cohesive modules contain logically related operations together into the same structure and that helps to define responsibility at a specific location. Designing loosely coupled modules decreases dependencies to other modules so a small change in one dependent module does not break other parts.

Tuesday, February 10, 2009

Why to use Hibernate for persistence layer

Instead of working directly with JDBC, Hibernate can be selected for ORM tool for your application's persistence needs.

When your application becomes larger and your requirements are not met by using JDBC, Hibernate comes to play.

Although there are many other benefits of using Hibernate, main sophisticated properties that a JDBC programmer encounters when working for the first time with Hibernate can be stated as follows:

Lazy loading : Most of the objects contain another objects in itself.

Consider, you have got a CreditCardApplication object which contains ApplicationRequestOwnerData and AdditionalInfo objects.

Assume that, you are retrieving a CreditCardApplication object, but you are not interested in the details of the ApplicationRequestOwnerData and AdditionalInfo objects in itself.

If it is unnecessary to fetch the whole object with its related objects, then lazy-loading brings a great effectiveness for your application.

Lazy-loading enables you to retrieve data as it is required.

Eager fetching : In opposite to lazy-loading, sometimes it is required to retrieve the whole object at a time. This decreases the cost of round trips.

Cascading : Support for cascading is another main benefit that you can design in your related hbm.xml file or annotations.

Generally speaking, using an ORM tool for persistence layer helps you to write less code in a shorter time period, if you use it effectively in your application.


hibernate.org is a great resource for new starters.