Friday, January 14, 2011
One more nice looking font
Enjoy.
Friday, December 10, 2010
JAVA IDE Fonts
Font Size: Usually I use 10-12 point fonts in Word documents, which in a swing app will look far too small. For a similar size you will have to use 16 pt. Apparently this is something to do with how DPI is used/calculated.
If you want the font to look reasonably thick, you end up increasing its height too much. Apparently this is not so much of an issue on OSX, but more of a Windows and Linux issue. Something to do with the way fonts are drawn by the JRE. Apparently Apple did a better job in their JRE implementation that Sun did.
Googling around I found a few things, which I thought can help fellow developers like me.
First JDeveloper 11g. Chris Muir had blogged about setting up the default size. On Windows 7 the location of the ide.properties will be in
C:\Users\
Edit this file only when JDeveloper is not running or else you find your edits over written when the IDE is closed. You can set the default font size.
Setting font size in Netbeans is well documented here.
Font face: I am just not happy with any of the fonts on Windows, because they always look scrawny. Again googling brough up this excellent post about Inconsolata. I had to install the TTF version before NetBeans was able to use it. The improvement was rather satisfying. On trying to set JDeveloper preferences however, lead to a unusual situation. The font would not show up on the list. I tried various things and gave up. Trying to fix it the next day, however, I was able to see it in the list. I am not sure if it showed up after I had switched off on the Display only Fixed Width fonts and rebooted the IDE or it was already there and I had not noticed it. Anyway, problem solved.
Monday, July 27, 2009
Why is server side OSGi AWOL?
As a basis for developing platforms, OSGi has garnered a lot of success. But what does does that mean to me? I don't work on platform development, perhaps >95% of IT community does not. My bills are paid by developing applications. Server side is what interests most people in Java, although, OSGi got its start on devices and desktop arguably Eclipse has answered it.
Yet, with all this much buzz, I felt I should check things out a bit. I did have a motivation to do so, because I was trying to look at ways by which I could componentize Portlets so that I do not get bitten by things I mentioned in my previous post.
After kicking some tires, I am still left with the feeling that all is not well in the OSGi land today. I will readily admit to my noobie status, still, following are some of the concerns I still have.
1. The benefits of OSGi are not obvious.
Modularity and componentizing has been such a big problem, for so long, there have been too many solutions which in many ways overlap or compete: EJB, POJO, Maven, (Web)services, DI, etc. the list is so long, you are already using many diluting the pay back. Much has been written about the benefits of OSGi, yet, nothing brought it home to me succinctly.
2. OSGi has a learning curve.
It needs an initial investment of time and effort. Words like Module, Component, Service, Bundle (well, maybe not bundle), etc. are already is wide use with conflicting / overlapping meaning and OSGi yet again over loads these words causing more confusion to the average developer. OSGi Alliance needs to invest a bit on developing well documented examples, patterns, best practices, something like what Sun did through J2EE Blueprints.
3. Tooling and IDE support is not ready for prime time.
I think in just rubber stamping an existing spec through JSR-291, we lost a huge opportunity to improve. Adding OSGi based Annotations could have helped a lot, by making this platform less Run-time focused and could have added Compile time/Deployment time support. I don't know all the politics of this, but Sun's No vote was very illuminating. The run-time focus of OSGi right now, is too dependant on being able to use a console. Not something I would be willing to deal with on a day-to-day. How about a platform independent Ant Tasks. I know of the ant wrapper on BND, I am talking about something more. Perhaps something that can augment/replace the runtime console. Does that need Distributed OSGi? That would be one way to do it. Alternatively, the spec already has a HTTP Service, which arguably can be used to incorporate this added functionality. Eating ones own dog food is good.
Squandering of JSR-291 opportunity has left relationship between OSGi bundles and WAR/EAR packaging and management fuzzy. Yes, I know, a bundle is just another jar, which can be dumped into a war like all the other jars one dumps into a war, but then you don't start or stop a jar at runtime.
4. Tomcat/OSGi integration today is non-existent.
This to me a huge gap. After all Tomcat is the most dominant webapp server today. There was some discussion among Tomcat developers regarding this for Tomcat 7, but nothing exists today. Unless there are easy ways of creating Bundles, packaging, deploying, debugging, it will fail to catch market share among application developers.
5. Distributed OSGi a necessity.
There is an RFC (the link goes to the entire set of specs of which RFC 119 is a part of), some talk about it, some development too, but it is not here yet with the exception of the reference implementation Apache CXF. I think when I can use a few Annotations and/or simple configuration, and get a nice Web Services based service, which can be started and stopped easily OSGi will always be one of those curiosities.
6. Framework Support a necessity.
OSGi does not define higher level services, but one needs Transaction Management, Dependancy Injection, QoS, Availability / failover / clustering, ability to locate and use services across applications, system, network, OS boundaries on and on. You can debate the choice of words here "Framework support", but I was kind of alluding to the type of added value Spring framework brings to a POJO. Till such functionality becomes available in a seamless manner, a developer will always be wondering how does OSGi fit into my application.
After a huge burst of interest when Eclipse 3 moved to OSGi 3 years back, somehow I get the feeling OSGi momentum is stalling. However, some powerful market forces are at work here. With Oracle acquiring Sun (Glassfish [when will v3 loose its Prelude moniker signalling production readiness? that's a whole different story]), BEA (Weblogic), what impact does that have? Will it further boost OSGi? It can, if Oracle Application Server also adopts it in a big way delivering a large pool of interoperable bundles across the 3 platforms. This can lead to an explosion of the repository of bundles, enabling one to grab ready-to-use-bundles and use it. That of course will finally bring home the benefits succinctly while answering the main question this blog poses.
My crystal ball sure is cloudy, how's yours?
Liferay messes up OpenSessionInView
If you are trying to use Lazy Loading in Hibernate you are dependant on OSIV. With OSIV confused, you can say good bye to Lazy Loading, Transaction Demarcation and all the good stuff inside a Portlet.
The only way I could get Lazy Loading to work was by extracting some pieces of code from Spring's OpenSessionInViewInterceptor, sticking it into my code and thus setting up transaction boundaries. Between these boundary points, I could get Lazy Loading to work.
From the perspective of compliance with the Portlet Specification JSR-168, what Liferay has done maybe right. The spec clearly splits up each request into Action and Render phases. The Portal is supposed to enable multiple portlets to respond to each of these phases in parallel. Chances are Liferay is internally using a pool of threads and dispatching requests in parallel. The side effect is that frameworks written for traditional web applications where it is assumed that the same thread is involved through out the request gets messed up.
Why Liferay did not make any effort to fix this issue is beyond me. It sure gave me a lot of heart burn.
In my case I had the code separated into a service class, and that helped, because I was able to extend org.springframework.orm.hibernate3.HibernateAccessor. I setup the start point of the transaction boundary by this code. Created a method startTransaction to do so.
currentSession = SessionFactoryUtils.getSession(
getSessionFactory(), true
);
setFlushModeName("FLUSH_NEVER");
applyFlushMode(currentSession, true);
TransactionSynchronizationManager.bindResource(
getSessionFactory(), new SessionHolder(currentSession)
);
Corresponding end point was setup through another method
endTransaction.
SessionHolder sessionHolder = (SessionHolder)TransactionSynchronizationManager.unbindResource(
getSessionFactory()
);
SessionFactoryUtils.closeSession(sessionHolder.getSession());
Tuesday, August 26, 2008
Data Driven Views - Is StringTemplate the best kept secret in template technologies?
Data Driven Views
I am always looking for new view technologies. Of special interest to me are what I would refer to as "Data Driven Views". There are 3 aspects to any page.- Structure or Layout
- Style
- Content
Some people might argue that Structure/layout and style are perhaps one and the same. Perhaps, but there are enough differences for me to consider them in their own right.
HTML munged all 3 together, and thus created a mess from which we have ever since been trying to dig ourselves out. CSS tried to extract style out and enable better control and authoring. Support for layout and structure have been improving over time.
It comes down to Who or What controls or generates each aspect of the page. From that standpoint in terms of view/page technologies there seems to exist a continuum from 100% manual on the left to totally machine generated on the right. Typical brochure ware/small website is at left end (manual) of the spectrum. Computer applications push towards the right to varying degrees. Being in this industry, I have an obvious interest in these technologies and am always on the look out for new technologies that push to the right.
A large set of templating technologies (ASP, JSP, XSL...) have been trying to nibble away at this for a long time. Another set of technologies that have been aiding this push to the right have been Content Management Systems. This is an area I will be returning to often.
Data driven views is all about this push to the right. How to enable the the
data being presented to determine all aspects of a page - Structure, Style and
Content. This is one theme I will be repeatedly returning to.
StringTemplate
Some time back I came across StringTemplate and what really caught my attention was that it was created by Terence Parr, who I respect a lot for his contributions to Computer Science. Despite the pedigree, it is still a hidden gem, I wonder why?From what little I have seen here are Pros and Cons of StringTemplate
Pros
- Strictly separates and enforces Model and View
- Small API
- Small language and syntax
- Flexible - can be used to generate pages or code.
- Great support - Terry himself answers a lot of forum posts.
Cons
- Yes, it lacks good documentation.
- Absence of IDE support
- Examples are lacking somewhat.
- Support from major frameworks like Spring are lacking.
- Yet another piece of technology to learn. Adds to the overall complexity of web applications.
I will be kicking the tires of this a bit and let's see what I can find out and if possible help mitigate some of the cons as well.
Monday, August 25, 2008
Welcome
I am Dinesh V. A technologist, entrepreneur, and single dad. I have varied interests including Science, Technology, Business and People. I am specially interested in Knowledge & Content Management, Web for the 21st century.
Ridiculous Ruminative Rants
sounds about right for what you will find here- posts on Life, Technology, Business and random posts. Nothing presumptuous, I will try and keep it light hearted.