Basic Doubts in Java & in Databases ? Ask Mr.Nagz.
DB:Differences between Stored Procedures and Functions:
Stored Procedures (SPROC)
1.Doesn't need to return values, but can return value.
2.Stored as a pseudo-code in database.i.e compiled form.
3.Can affect the state of database using commit.
4.Cannot be invoked from SQL Statements.[SELECT]
5.Procedures are mainly used to process the tasks.
User Defined Function[UDF]
1.Should return atleast one update parameter.Can return more than one parameter using OUT argument.
2.Parsed and compiled at runtime.
3.Cannot affect the state of database.
4.Can be invoked from SQL Statements [SELECT]
5.Functions are mainly used to compute values
--------------------------------------------------------------------------------
JAVA:What are Runtime Polymorphism & Compile time Polymorphism ?
Polymorphism is defined as one interface to control access to a general class of actions.There are two types of Polymorphism .
1.Compile Time Polymorphism
Compile time polymorphism is functions and operators overloading(C++)
2.Runtime polymorphism
Runtime polymorphism is done using inheritance and virtual functions(C++)
--------------------------------------------------------------------------------
JAVA:When should I use static class and when a singleton class?
I guess when I am creating some kind of library or utility class, I will prefer static class. e.g. if I create a string utility class, where I am not saving or handling any data, I will use static methods
--------------------------------------------------------------------------------
JAVA:Why Hibernate is gaining popularity or what are the drawbacks of ejb 2.1?
CMP beans are defined in one-to-one correspondence to the tables of the
relational model. Thus, they’re too coarse grained; they may not take full
advantage of Java’s rich typing. In a sense, CMP forces your domain model
into first normal form.
On the other hand, CMP beans are also too fine grained to realize the stated
goal of EJB: the definition of reusable software components. A reusable
component should be a very coarse-grained object, with an external interface
that is stable in the face of small changes to the database schema. (Yes,
we really did just claim that CMP entity beans are both too fine grained and
too coarse grained!)
Although EJBs may take advantage of implementation inheritance, entity
beans don’t support polymorphic associations and queries, one of the defining
features of “true” ORM.
Entity beans, despite the stated goal of the EJB specification, aren’t portable
in practice. Capabilities of CMP engines vary widely between vendors, and
the mapping metadata is highly vendor-specific. Some projects have chosen
Hibernate for the simple reason that Hibernate applications are much
more portable between application servers.
Entity beans aren’t serializable. We find that we must define additional data
transfer objects (DTOs, also called value objects) when we need to transport
data to a remote client tier. The use of fine-grained method calls from the
client to a remote entity bean instance is not scalable; DTOs provide a way of
batching remote data access. The DTO pattern results in the growth of parallel
class hierarchies, where each entity of the domain model is represented
as both an entity bean and a DTO.
EJB is an intrusive model; it mandates an unnatural Java style and makes
reuse of code outside a specific container extremely difficult. This is a huge
barrier to unit test driven development (TDD). It even causes problems in
applications that require batch processing or other offline functions.
-----------------------------------------------------------------------------------
Saturday, January 06, 2007
Previous Posts
- HTTP Header from a web site using TELNET You can ...
- When the end of the world arrives how will the med...
- 1-800-PSYCH............ Hello, Welcome to the Ps...
- Bizarre facts .. but true. 1. Coca-Cola was origi...
- Cool Ones......njoy. 1.A foolish man tells a wom...
- Validations in Javascript Email Validations if ...
- Lets play with the modem provided by Airtel,BSNL !...
- Looking for a Change in your Career. Need Consulta...
- Info About java.sql.DriverManager......... All j...
- Questions on JDBC.................. What is JDB...

0 Comments:
Post a Comment
<< Home