Rohit Prabhakar

I build agentic revenue systems for Fortune 50 companies

  • Digital Transformation
  • Leadership
  • Marketing
  • Writing
  • Home
  • Privacy Policy

Eclipse: How to fix OutOfMemoryExceptions or just for performance improvement.

May 12, 2010 by Rohit Prabhakar 1 Comment

I would suggest the following changes to your eclipse environment. Please go to the eclipse shortcut and open the properties. In the Target just after the path to the .exe copy the machine specific arguments.


RECOMMENDED ARGUMENTS (you can play with the exact numbers based on your machine configuration)

RAM: 1GB

-vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m

RAM 2 GB

-vmargs

Filed Under: Programming, The Frontier Tagged With: Class, Data, Data structure, eclipse, eclipse performance, eclipse performance tuning, Gigabyte, heap, heapSize, Java, Java Virtual Machine, Languages, out of memory, outofmemory, OutOfMemoryExceptions, performance tuning, perm, permSpace, Programming, Random-access memory, rohit, vmargs, Xms, Xmx, XX:MaxPermSize, XX:PermSize

Spring Framework Basics

February 12, 2010 by Rohit Prabhakar Leave a Comment

Today I was asked by few of my colleagues to give a brief introduction about Spring Framework. I created this presentation and hope this is also able to help you. Comments are appreciated!
Spring Framework Rohit

View more presentations from Rohit Prabhakar.
Here is some more code if you would like to understnad how can a class can be injected and used in other class.
Changes Made:
  1. Added: PrintMe.java
  2. Changed: HelloWorldImpl2.java, applicationContext.xml

Scenario: Use another class

Filed Under: Technology, The Frontier Tagged With: .net, dependency injection, inject a bean, inversion of control, IOC, Java, MVC, Rod Jhonson, rohit, Spring, spring framwework, Technology

Sun in Oracle!

February 6, 2010 by Rohit Prabhakar Leave a Comment

Things are becoming more clear about the takeover of Sun by Oracle (Don’t worry the Sun will still shine). The world’s most popular programming language is surely going to live and evolve but, Sun cloud is no more a story but  a history!

Detailed story

A very good post on the acquisition 5 Opportunities and 3 Threats for Oracle. Must read!!

Filed Under: Technology, The Frontier Tagged With: Java, oracle, rohit, Sun, sun cloud

How to run ant build file from eclipse (if no ANT option in RUN)

February 3, 2010 by Rohit Prabhakar 4 Comments

If you have some version of MyEclipse (Enterprise Workbench 6.6.0) which has no option to run a build file with ANT and you are confused on how to run the build in the eclipse, please follow the following steps:

  1. Go to the project
  2. Select build_XXX.xml
  3. Go to “Run As” icon and click “Open External Tools Dialog…”
  4. A new pop-up window for External Tools will appear with an option “Ant Build”
  5. Right click on “Ant Build” and click on option “New”
  6. A new ANT build task will be created and will look like the following
  7. Go to “Properties” tab and deselect option “Use global properties as specified in the Ant runtime preferences”
  8. Create a new file “[SomeName].properties” and write the required build properties into it.
  9. Click on “Add External…” and select the file created in step 8.
  10. The pop-up window will look like the following.
  11. Click on APPLY
  12. Click on RUN
  13. Check Console for any errors or Success message

Filed Under: Technology, The Frontier Tagged With: ant, build script, eclipse, how to build in eclipse, Java, run

Java Tiger (Java 5) is a history

December 16, 2006 by Rohit Prabhakar Leave a Comment

Java Tiger (Java 5) is a history now after one more release from the sun, now we have Java 6. Sun has finally announced the availability of Java Standard Edition 6‘ final release.

The new release has an improved JIT, with better runtime analysis. This has been well tested and agreed upon by the users of the pre-release version. Those who used the pre-release version have put the improvement in performance between 5%- 24%. The new release also has dynamic language support as now it comes with JavaScript engine (Netscape’s Rhino) and support for many other scripting languages like Ruby, and Python.

For the guys who are working with the rich clients, the new release has splash screen, system tray support etc.

The new Java6 profilers and debuggers can now attach to a running JVM without specifically using a debugging-capable configuration. For example, if a problem is found at run-time for a production server, a debugger can attach to it without restarting the server, a valuable feature for issues that show up after the server has been running for a long period. This is a great feature for the guys in the enterprise community.

You can read more in detail at http://java.sun.com/javase/6/

Happy Programming!

content from http://prabhakars.blogspot.com/atom.xml

Filed Under: Programming, The Frontier Tagged With: Chandigarh, Computers, Java, Prabhakar, Rohit Prabhakar, Tiger

Spring Framework- Digest

August 4, 2005 by Rohit Prabhakar Leave a Comment

As I was going through some articles on the web regarding the “Spring framework”, following is what I thought can be a digest for what is Spring framework and its benefits.

Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development.
The Spring framework
The Spring framework is a layered architecture consisting of seven well-defined modules. The Spring modules are built on top of the core container, which defines how beans are created, configured, and managed, as shown in Figure 1.

Figure 1. The seven modules of the Spring framework

Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows:
The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application’s configuration and dependency specification from the actual application code.
Spring context: The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality.
Spring AOP: The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.
Spring DAO: The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO’s JDBC-oriented exceptions comply to its generic DAO exception hierarchy.
Spring ORM: The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring’s generic transaction and DAO exception hierarchies.
Spring Web module: The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.
Spring MVC framework: The MVC framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.
Spring framework functionality can be used in any J2EE server and most of it also is adaptable to non-managed environments. A central focus of Spring is to allow for reusable business and data-access objects that are not tied to specific J2EE services. Such objects can be reused across J2EE environments (Web or EJB), standalone applications, test environments, and so on, without any hassle.
IOC and AOP
The basic concept of the Inversion of Control pattern (also known as dependency injection) is that you do not create your objects but describe how they should be created. You don’t directly connect your components and services together in code but describe which services are needed by which components in a configuration file. A container (in the case of the Spring framework, the IOC container) is then responsible for hooking it all up.
In a typical IOC scenario, the container creates all the objects, wires them together by setting the necessary properties, and determines when methods will be invoked. The Spring framework uses the Type 2 and Type 3 implementations for its IOC container.
Aspect-oriented programming
Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules.
AOP and IOC are complementary technologies in that both apply a modular approach to complex problems in enterprise application development. In a typical object-oriented development approach you might implement logging functionality by putting logger statements in all your methods and Java classes. In an AOP approach you would instead modularize the logging services and apply them declaratively to the components that required logging. The advantage, of course, is that the Java class doesn’t need to know about the existence of the logging service or concern itself with any related code. As a result, application code written using Spring AOP is loosely coupled.
AOP functionality is fully integrated into the Spring context for transaction management, logging, and various other features.

BENEFITS of using Spring MVC

1. Spring provides a very clean division between controllers, JavaBean models, and views.
2. Spring’s MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.
3. Spring, like WebWork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.
4. Spring MVC is truly view-agnostic. You don’t get pushed to use JSP if you don’t want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism – for example, your own templating language – you can easily implement the Spring View interface to integrate it.
5. Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.
6. Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.
7. The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.
Spring vs. Struts? for complete article read.. ()
Spring doesn’t compete against Struts at least, not directly. You can use Struts for your front-end and have Spring hold your model. However, Spring can stand on Struts shoulders and has implemented the front-end, and in the process, solved some of Struts thorny bits.
My biggest complaint with Struts is its tight coupling with JSPs, and Spring allows support for JSP, Velocity and FreeMarker right out of the box. Now I can create controllers and even form validating beans without the need for complicated, difficult-to-maintain JSP code.
I realize the benefits listed above are good reasons to go with Spring MVC over Struts but how popular is Spring MVC and how much is it actually being used out there is still to be seen?
One article that says no to springs and is in favor of struts can be found at
Please revert back with your comments and queries :o)

content from http://prabhakars.blogspot.com/atom.xml

Filed Under: Technology, The Frontier Tagged With: .net, Chandigarh, dependency injection, framework, inversion of control, IOC, Java, MVC, Rod Jhonson, rohit, Rohit Prabhakar, Spring, spring framwework, Technology

Copyright © 2026 · Genesis Framework · WordPress · Log in