Win a copy of Terraform in Action this week in the Cloud forum!

Karthick Sundaram

Greenhorn
+ Follow
since Feb 04, 2007
Karthick likes ...
Eclipse IDE VI Editor Ubuntu
Edinburgh
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karthick Sundaram

Junilu Lacar wrote:It's hard to be specific about these things. In general though, I always fall back to basic design principles and design patterns. Most problems come from violating the SOLID, SLAP, and DRY design principles. If you use modern frameworks properly, a lot of the technical issues are already taken care of for you by the framework developers. Knowing how to use the frameworks properly and making good design choices based on the basic principles keeps you out of a lot of trouble.



Thank you for the SOLID, SLAP, and DRY design principles. I am writing and have written code that adheres to some of these priniciples. I will try to incorporate the remaining into my mind, so that it gets used when I write code from now on. But the problem I have had is - When you give an estimate of time required to complete a task, that includes writing tests, I am asked, what would be the estimate without the tests. :-) That to me is like some one looking to buy a car and bargaining with you, that I do not need the brakes, what is the price now. I am not able to justify the use of tests and I think that they need to be educated about the craft of software development.

T. Sharma wrote:I would like to go to the original question. Unfortunately, it is not rare to see such cases (where tests are completely missing). To counter this, Michael Feathers proposed the "legacy code change algorithm" in his book (Working Effectively with Legacy code):

  • Identify change points
  • Find test points
  • Break dependencies
  • Write tests
  • Make changes and refactor

  • One should try to follow this to overcome the situation. It is to be realized that the situation cannot be changed completely overnight.

    A quote from the same source (that I like a lot): "Over time, tested areas of the code base surface like islands rising out of the ocean."



    Exactly What I was looking for. Thank you very much. :-)
    Junilu & Chris

    I agree with both of you, because it seems common sense to me and is easy to refactor at the early stages.

    Thanks
    Karthick
    Hi all,

    This is a problem that we have in my current project. We have very few tests and the application that we have built is a monster and the number of developers is so huge. And the management think that if 10 developers do a job in 10 days, then 100 developers can do the same job in 1 day. We touch one piece of code and it breaks several existing functionalities. So what gets added is a hack finally. And every body is risk averse to refactor. We have a few Junits and a few Selenium tests.

    So let us say there is some piece of software that we are required to maintain and that is a distributed application and no tests existing. We have lots of new requirements coming up, which we will have to build into the existing system, without breaking existing functionality. How do we start. I believe it starts with writing tests for existing functionality and then refactoring them as needed. and then proceeding for developing new features. Please let me know if otherwise.
    Here we are talking about a distributed application. How do we start.
    If we thought of a SOA project, where everything is decoupled from everything else and there is indirection. We do not have the definite list of consumers and producers for the services that we have. How do we start writing our tests.

    Eagerly looking forward to your answers.

    Thanks,
    Karthick
    Welcome Chris, I have been on three greenfield software projects so far and all of them had degraded their initial design at some point either due to developers/architects leaving or because the design/code couldn't evolve because of other pressures from project management. But later on we come to the point where it becomes unmaintainable. That's the point when management is ready to listen. If we said that we could refactor and bring it to safety, that would be a relief for them. If we were not able to refactor, then either the project fails or if it survives, it is painful for the developers like long work hours for forever. I have seen that in two of my three projects so far. lucky enough to have escaped the first one. So refactoring is a serious need for developers like me.

    Looking forward to the discussion.

    Cheers.
    Karthick
    Hi,

    I'm a beginner with XML and need some basic help.

    This is the general external reference to a DTD.

    <!DOCTYPE root-element SYSTEM "filename">

    And this is a specific example.

    <!DOCTYPE note SYSTEM "Note.dtd">

    Where should the Note.dtd file be placed, so that the xml document is validated against this dtd?

    Thanks,
    Karthick
    Hi All,

    I'm facing a peculiar problem when using Teradata Datasources with Websphere .well..the version is 5.X.. (has jdk 1.4)

    I'm using Teradata JDBC Driver. I've configured it on the console. And When I test the Datasource, it says connection successful.

    When I use the application, I'm getting an exception. I'm putting forward what all I have done in configuring the Datasource and JDBC provider.

    I made an entry for the teradata driver in the Websphere env variables: /apps/dw/saart/htdocs/SAARTONLINEWebEAR.ear/SAARTONLINEWeb.war/WEB-INF/lib/

    I've added a JDBC Provider specifying the jar file containing the driver and the TeraconnectionpooDataSource class which is the implementation class.

    under Datasource I created a Datasource TeradataDatasource and provided a jndi name. and added a few custom properties like user,password,DATABASE,DSName.

    I added J2C authentication entries also with the username and the password and mapped it against (component managed alias) when I installed the application.

    When I'm testing the connection for the Datasource, it says connection is successful, but when I'm trying to access from the application(servlet), it throws an exception.

    Context ctx = new InitialContext();
    dataSource =(DataSource)ctx.lookup("jdbc/teradata");
    connection = dataSource.getconnection() //earlier I tried with getConnection("uatb01","uatb01"); Doesn't work
    stmt = connection.createStatement();
    rset = stmt.executeQuery(query.toString());

    The exception thrown is


    Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/teradata, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: [NCR] [Teradata DBMS] : Invalid password.. with SQL State : 28000 SQL Code : 3003

    All the passwords are working fine. I tried logging on to the Teradata machine. I'm able to execute queries.

    I've attached a compressed archive. It contains the screenshots of the Websphere admin console. and also the jar files which contain the Teradata driver files. all the jar files are in the class path.

    The same configurations are working for WAS 6. I'm trying to find out why this is not working for WAS5.

    I really appreciate all your suggestions and help.

    Thanks.
    Karthick
    14 years ago
    Jigar,

    you need the web.xml by default..because that helps the container in identifying that it is a web-app.

    Only thing for a JSP is that you don't have to have the <servlet> and the <servlet-mapping> tags in the web.xml
    14 years ago
    >> "when in write jsp declration tag <%! public void a(){} %>
    this will go into init() method of servlet"


    <%! somevalidjavadeclaration %>
    No It goes outside the init() method..
    1.as another method if it is a method declared..
    2.or as an instance variable if some variable was declared

    >> "but when i write Expression <% public void a(){} %>
    this will go into service() method of servlet"

    <% SomeValidJavaVariableDeclaration %>
    It goes inside the service() method.

    You can only have a variable declared or defined. but not a method.(How can a method go into another method?)
    14 years ago
    Because using a session requires setting a JSESSIONID cookie in the response. And we are not supposed to use cookies if we are forwarding..right??
    14 years ago
    And similarly for a request to be forwarded, nothing should be written to a response..

    But request attributes can be added before forwarding.

    Hey I got another doubt..

    But we can't have a session attribute before forwarding.. right? Because that requires a session.
    14 years ago
    And similarly for a request to be forwarded, nothing should be written to a response..

    But request attributes can be added before forwarding.

    Hey I got another doubt..

    But we can't have a session attribute before forwarding.. right? Because that requires a session.
    14 years ago
    We will not be able to do a redirect if we write something to the response..

    Writing something to the response also includes setting headers, cookies, contenttype

    Creating a session creates a SessionID cookie to be set in the response.

    Did this answer your question?
    14 years ago