In a JSF based project, we have a library with common components. In our menu component, we have overriden the isRendered method to follow authorization rules. So, displaying a menu depends on the user being logged. Taking into account that is a common library, the implementation of the authorization rules must be fullfilled by each project using the library.
The menu component has a method to evaluate visibility regarding authorization permit, let's say checkVisibility. The trick is call a static class inside this method. The static class, let's say CheckStatic, has just a single method evaluateVisibility . CheckStatic has an interface CheckingRulesInterface. The only method calls the interface method that really checks visiblity. The project using the menu item should implement the interface. Using Spring factory bean definitions, we can configure the static class with the proper interface implementation.
MenuItem{
checkVisibility(){
return CheckStatic.evaluateVisibility();
}
}
CheckStatic{
CheckingRulesInterface checkIt;
evaluateVisibility(){
return checkIt.reallyCheckIt();
}
}
Sunday, November 21, 2010
Tuesday, November 9, 2010
Speed up your reports!
I've found an interesting post at Goodman on BI. It explains how to use a dedicated datawarehouse database (DynamoDB) to load partial data just for the required report or reports.
The idea is extract the data from the MySql OLTP and load it into de datawarehouse database.
So ... can this approach used to do real time reporting? I guess. Using an in-memory database and selecting just the requeried data, some reports could be runned with enough spped and accuracy.
I must need find some free hours to try this approach.
The idea is extract the data from the MySql OLTP and load it into de datawarehouse database.
So ... can this approach used to do real time reporting? I guess. Using an in-memory database and selecting just the requeried data, some reports could be runned with enough spped and accuracy.
I must need find some free hours to try this approach.
Sunday, November 7, 2010
Choosing BIRT
Good points,...
You can use any number of datasources in your report. They can be just diferent queries from the same database and even totally diferent databases.
You can use Java, Javascript inside your reports to perform calculations, change styles, fill values...
The report design process it's more like building an HTML page than usual band oriented reports.
A free open-source web application it's available to run the reports with pagination, export options and parameters selection.
Many and good report examples and tips are available.
Not so good, ...
The so many libraries needed to run the reports.
The web application it's a little bit complex to customize.
Learning curve it's steep.
You can use any number of datasources in your report. They can be just diferent queries from the same database and even totally diferent databases.
You can use Java, Javascript inside your reports to perform calculations, change styles, fill values...
The report design process it's more like building an HTML page than usual band oriented reports.
A free open-source web application it's available to run the reports with pagination, export options and parameters selection.
Many and good report examples and tips are available.
Not so good, ...
The so many libraries needed to run the reports.
The web application it's a little bit complex to customize.
Learning curve it's steep.
Datawarehouse key concepts
When I first was asked to build a BI platform, I started reading The DataWarehouse toolkit Kimball book. I must say I had almost no idea of the complexity involved in datawarehouse construction. Soon, I reached two main tips related to database modelization:
1.- model your relationships as 1-1
2.- avoid null values
Simple and powerfull. From a database model point of view, first tip allows join tables easyly and second tip gives better performance when indexes are involved. Both tips are oriented to obtain better query performance. Of course, these are more key concepts, but these two are really important.
1.- model your relationships as 1-1
2.- avoid null values
Simple and powerfull. From a database model point of view, first tip allows join tables easyly and second tip gives better performance when indexes are involved. Both tips are oriented to obtain better query performance. Of course, these are more key concepts, but these two are really important.
Pentaho configurable datasources
Pentaho allows to define any number of datasources through Administration Console or plain INSERT statements in DATASOURCE table. Then you can use the given jndi names in your xaction. So if you have 20 xaction you write it 20 names. But what if the name must be changed for different enviroments or installations? It would be better don't harcode the jndi names, isn't it?
The solution is to write a simple xml to define available jndi names. Something like:
<xml>
<reporting_ds>MyDS</reporting_ds>
<etl_ds>MyETLDatasource</etl_ds>
</xml>
You only need to query this xml file in your xaction to obtain the jndi name before doing anyhting else. There's a really simple step process to query xml files using xpath expressions.
You can even put the whole querying process inside a xaction that you can call from any other xaction.
The solution is to write a simple xml to define available jndi names. Something like:
<xml>
<reporting_ds>MyDS</reporting_ds>
<etl_ds>MyETLDatasource</etl_ds>
</xml>
You only need to query this xml file in your xaction to obtain the jndi name before doing anyhting else. There's a really simple step process to query xml files using xpath expressions.
You can even put the whole querying process inside a xaction that you can call from any other xaction.
Subscribe to:
Posts (Atom)