Not only some words from a Rush song...
Just imagine smb. telling you he would kick you after you have some controversy. He describes very detailed how his right leg will draw a semicircle in the air and his heel will then land directly on your nose messing up your bones and body fluids. But then, nothing happens. You wait, ready to defend your health and pride, but still nothing happens...
Brutal? Not a bit. Stupid? Absolutely! Do you trust an architect who is nerving you for hours with his "cosmik debris" (hey, Frank used to be more concrete) and who is not able to demonstrate you how his stuff works? Not in PowerPoint, but in the reality? I don't.
Show Me, Don't Tell Me!
9/23/2008
9/20/2008
"We" instead of "I"?
Why do some standalone freelancers want to act like a firm talking about "we have experience here" instead of "I am experienced with this"? I mean, by simply looking at the type of your company everybody knows what's going on, right? Is this a lack of confidence? Do you wish to play around with big guys but without risking to become a real enterpreneur? Do you really mean it can legitimate higher rates? Don't you mean it sounds weird? Maybe a shadow of schizophrenia?
Oh my goodness, please stop talking of you as a CEO being a standalone freelancer. An officer without soldiers is not an officer but a soldier. Or a jester.
You are your capital! If this is not enough, establish a real firm (I mean, hiring employees or so) or leave it and take a permanent position. There, you can talk about "we" and nobody will think it sounds absurd. Otherwise they really do, at least I do.
Oh my goodness, please stop talking of you as a CEO being a standalone freelancer. An officer without soldiers is not an officer but a soldier. Or a jester.
You are your capital! If this is not enough, establish a real firm (I mean, hiring employees or so) or leave it and take a permanent position. There, you can talk about "we" and nobody will think it sounds absurd. Otherwise they really do, at least I do.
9/06/2008
The Whole Team Is The Architect
It is absolutely not ok to expect that one who has been named as the architect in the project is also the only one who is responsible for the whole architecture. Further, it is not ok to think that you are the only one who decides about the whole architecture if you are the project's named architect.
One person cannot and must not do the whole job alone. The job of the project architect is much more to plan ahead and to moderate the team's discussions and decisions concerning the architecture. It is his job to boost a mental and a technical frameworks used by the team to succeed with the project. It is definitely not his job to play the decision bottle neck or even the god.
The whole team is the architect of a solution since the architecture not only includes hard technical things but also procecces for communication with customers as well as different functional stuff which is much more important than whatever awesome techniques. There is even much more soft parameters beyond the technical side of a successful solution.
The point is to make the team design, develop and represent the architecture as a team, not just by naming persons to play some roles. The architecture is never done, its lifecycle ends with the death of the solution, and it's always moving on. It will not succeed if not the whole team stays behind it as one man.
So, to follow the principle of a self-organizing team it is also highly recommended to assign the architect role to the whole team. Some of the guys will sure moderate the technical discusions and spend more time developing the technical framework instead of writing functional code. This is the technical architecture work and of course decissions will have to be made there, so the whole team participates those decissions.
Never let the one and only person decide! The whole team is the architect of the whole solution, and everybody applies himself.
One person cannot and must not do the whole job alone. The job of the project architect is much more to plan ahead and to moderate the team's discussions and decisions concerning the architecture. It is his job to boost a mental and a technical frameworks used by the team to succeed with the project. It is definitely not his job to play the decision bottle neck or even the god.
The whole team is the architect of a solution since the architecture not only includes hard technical things but also procecces for communication with customers as well as different functional stuff which is much more important than whatever awesome techniques. There is even much more soft parameters beyond the technical side of a successful solution.
The point is to make the team design, develop and represent the architecture as a team, not just by naming persons to play some roles. The architecture is never done, its lifecycle ends with the death of the solution, and it's always moving on. It will not succeed if not the whole team stays behind it as one man.
So, to follow the principle of a self-organizing team it is also highly recommended to assign the architect role to the whole team. Some of the guys will sure moderate the technical discusions and spend more time developing the technical framework instead of writing functional code. This is the technical architecture work and of course decissions will have to be made there, so the whole team participates those decissions.
Never let the one and only person decide! The whole team is the architect of the whole solution, and everybody applies himself.
9/05/2008
How To Map The Oracle Table Type Returned By A Stored Procedure In Hibernate
Hibernate is a very powerfull and mature framework for O/RM. It not only allows you to map more or less simple tables and relations into you Java object graphs but also to handle many database system specific features transperently still using them.
Since it is unrealistic to replace one expensive RDBMS with an other, and since nobody really does it, it is absolutely advisable to get all out of your RDBMS installation to have the best possible performance (we don't further specify this complex term for brevity).
Your DBA will want to play around with stored procedures, some hints and further RDBMS specifics. Don't stop him or her - what counts is the fastest possible solution, not the high level of abstraction which cannot be seen and so, cannot be appriciated by the customer. Just make it fly!
Let's consider Oracle. In situations where a complex logic is necessary to build a result set, the stored procedure is the best performing thing since you don't leave the borders of the Oralce instance. Sometimes, your DBA would like not only to return a ref cursor from the stored procedure, but maybe a table type such as numtable. Can you map it via Hibernate somehow or do you have to abdicate your mapping? The answer is: map it. How? Here we go:
First of all, we declare an XML-based mapping:
<hibernate-mapping lazy="false">
<class name="dummy.TestTable">
<id name="id"/>
</class>
<sql-query name="testSP">
<return alias="id" class="dummy.TestTable"/>
select column_value as id from table(pkg_test.sp(?))
</sql-query>
</hibernate-mapping>
We simply want to map ID into a POJO - we don't even need to futher consider it. We also define a named native sql query where we use the Oracle specific syntax to get a table type from a stored procedure call. The stored procedure itself returns a numtable in this case.
Here is the code to make it run:
Query q = session.getNamedQuery("testSP");
q.setParameter(0, new Long(0));
List l = (List)q.list();
That's it. Simple? Yeah!
Since it is unrealistic to replace one expensive RDBMS with an other, and since nobody really does it, it is absolutely advisable to get all out of your RDBMS installation to have the best possible performance (we don't further specify this complex term for brevity).
Your DBA will want to play around with stored procedures, some hints and further RDBMS specifics. Don't stop him or her - what counts is the fastest possible solution, not the high level of abstraction which cannot be seen and so, cannot be appriciated by the customer. Just make it fly!
Let's consider Oracle. In situations where a complex logic is necessary to build a result set, the stored procedure is the best performing thing since you don't leave the borders of the Oralce instance. Sometimes, your DBA would like not only to return a ref cursor from the stored procedure, but maybe a table type such as numtable. Can you map it via Hibernate somehow or do you have to abdicate your mapping? The answer is: map it. How? Here we go:
First of all, we declare an XML-based mapping:
<hibernate-mapping lazy="false">
<class name="dummy.TestTable">
<id name="id"/>
</class>
<sql-query name="testSP">
<return alias="id" class="dummy.TestTable"/>
select column_value as id from table(pkg_test.sp(?))
</sql-query>
</hibernate-mapping>
We simply want to map ID into a POJO - we don't even need to futher consider it. We also define a named native sql query where we use the Oracle specific syntax to get a table type from a stored procedure call. The stored procedure itself returns a numtable in this case.
Here is the code to make it run:
Query q = session.getNamedQuery("testSP");
q.setParameter(0, new Long(0));
List
That's it. Simple? Yeah!
9/04/2008
Generating Static Web Sites From Joomla!
Joomla is a very nice, widely extensible and free content management system. But it expects you or your ISP to run the whole stack including PHP, MySQL and whatever else even if you just whant to present a bunch of static pages on the web.
But there is a way to avoid the stack by generating static content. As far as I know, Joomla doesn't really support this since there are very dynamic features with it which wouldn't make sence to run statically.
All you need to do is to point a web site grabber on your joomla root and to make it work. But, all free grabbers I've tested either have generated smth. fully unuseful outcome or simply stopped working. Then, I've decided to do it classic way using the UNIX wget tool. Here is the result:
1. Create a web site with a locally installed Joomla omitting all that really dynamic stuff but using articles only (for server installation, just modify the host and the shares I use here)
2. If on Windows, use Cygwin, If not so or even so, you need some modifications to the following script to use your local paths. For the script to run, you need Perl
3. Here is the script:
#!/usr/bin/perl
$dir = "/cygdrive/c/xampp/htdocs/YOURSITE";
$tmpl = "/cygdrive/c/xampp/htdocs/joomla/templates/YOURTEMPLATE/html/";
$sys = "/cygdrive/c/xampp/htdocs/joomla/templates/system/html/";
#let wget dance
system("cd $dir; rm -rf *; wget -r -x -p -nH -k -nd -E localhost/joomla/");
#do some post modifications
opendir __DIR, "$dir";
@files = readdir __DIR;
#iterate over the generated files
foreach $file (@files) {
#we're only interested in CSS files
if ($file =~ m/^.*\.css$/is) {
open _F, "<$dir/$file"; $tmp = join "", <_f>;
#find all referenced images and rewrite the reference. Also copy the image from the template
while ($tmp =~ m/url\((\.\.\/images\/{0,1}[^\)]*?\/)(.*?)\)/is) {
system("cp $tmpl$1$2 $dir");
system("cp $sys$1$2 $dir");
$fn = $2;
$fn =~ s/.*\/(.*)/$1/is;
system("chmod 644 $dir/$fn");
$tmp =~ s/url\(\.\.\/images\/{0,1}[^\)]*?\/(.*?\))/url($1/is;
}
close _F;
open _F, ">$dir/$file";
print _F $tmp;
close _F;
}
}
closedir __DIR;
#do ftp upload
system("lftp -f ftp.txt");
4. Modify paths and extend the script to also copy your images and other stuff. I use a flat target directory, so some modifications are also necessary to work with a subfolder structure.
5. ftp.txt contains the upload commands for lftp
That's it.
But there is a way to avoid the stack by generating static content. As far as I know, Joomla doesn't really support this since there are very dynamic features with it which wouldn't make sence to run statically.
All you need to do is to point a web site grabber on your joomla root and to make it work. But, all free grabbers I've tested either have generated smth. fully unuseful outcome or simply stopped working. Then, I've decided to do it classic way using the UNIX wget tool. Here is the result:
1. Create a web site with a locally installed Joomla omitting all that really dynamic stuff but using articles only (for server installation, just modify the host and the shares I use here)
2. If on Windows, use Cygwin, If not so or even so, you need some modifications to the following script to use your local paths. For the script to run, you need Perl
3. Here is the script:
#!/usr/bin/perl
$dir = "/cygdrive/c/xampp/htdocs/
$tmpl = "/cygdrive/c/xampp/htdocs/joomla/templates/YOURTEMPLATE
$sys = "/cygdrive/c/xampp/htdocs/joomla/templates/system/html/";
#let wget dance
system("cd $dir; rm -rf *; wget -r -x -p -nH -k -nd -E localhost/joomla/");
#do some post modifications
opendir __DIR, "$dir";
@files = readdir __DIR;
#iterate over the generated files
foreach $file (@files) {
#we're only interested in CSS files
if ($file =~ m/^.*\.css$/is) {
open _F, "<$dir/$file"; $tmp = join "", <_f>;
#find all referenced images and rewrite the reference. Also copy the image from the template
while ($tmp =~ m/url\((\.\.\/images\/{0,1}[^\)]*?\/)(.*?)\)/is) {
system("cp $tmpl$1$2 $dir");
system("cp $sys$1$2 $dir");
$fn = $2;
$fn =~ s/.*\/(.*)/$1/is;
system("chmod 644 $dir/$fn");
$tmp =~ s/url\(\.\.\/images\/{0,1}[^\)]*?\/(.*?\))/url($1/is;
}
close _F;
open _F, ">$dir/$file";
print _F $tmp;
close _F;
}
}
closedir __DIR;
#do ftp upload
system("lftp -f ftp.txt");
4. Modify paths and extend the script to also copy your images and other stuff. I use a flat target directory, so some modifications are also necessary to work with a subfolder structure.
5. ftp.txt contains the upload commands for lftp
That's it.
9/03/2008
It Doesn't Make Qualified If Just Getting Named
The role of the architect is very project dependent. Smb. being architect in one project doesn't automatically earn the licence to become the architect of the next one since it strongly depends on the domain qualification as well as different political constraints. You can only have an extra bonus for being considered as the architect of the next project having been the architect of the previous one - of course, if you did your job well :-)
But often there is a situation where smb. simply gets named by the management as the one and only architect without having that broad qualification to fit the role but having a good management support. One forgets that the architect is a role in a project but not a fixed position at all. It is definitely not sufficient to be named as architect. It is absolutely necessary to do this job, to take responsability and to go ahead. And it is necessary to have the experience and the right qualification to do it - I don't mean a degree, I just mean the right soft and hard skills.
But here an other thought: it seems to enhance the prestige somehow, even if the real job stays abandoned. One seems to think that being called architect makes one more attractive for girls, or whatever they think. Hey, you're not a rock star - you are a developer having experience and qualification for basic work - maybe, or you've just been named by the boss to fill out some white space on your business card. There is no glamor, no shining, just a sort of more abstract developer work.
Don't forget: named and qualified is a bit different concerning an architect. A lot of doing follows the naming, and if not, it isn't even worth thinking about it.
But often there is a situation where smb. simply gets named by the management as the one and only architect without having that broad qualification to fit the role but having a good management support. One forgets that the architect is a role in a project but not a fixed position at all. It is definitely not sufficient to be named as architect. It is absolutely necessary to do this job, to take responsability and to go ahead. And it is necessary to have the experience and the right qualification to do it - I don't mean a degree, I just mean the right soft and hard skills.
But here an other thought: it seems to enhance the prestige somehow, even if the real job stays abandoned. One seems to think that being called architect makes one more attractive for girls, or whatever they think. Hey, you're not a rock star - you are a developer having experience and qualification for basic work - maybe, or you've just been named by the boss to fill out some white space on your business card. There is no glamor, no shining, just a sort of more abstract developer work.
Don't forget: named and qualified is a bit different concerning an architect. A lot of doing follows the naming, and if not, it isn't even worth thinking about it.
Subscribe to:
Comments (Atom)