1 Replies - 6206 Views - Last Post: 23 October 2012 - 08:03 PM Rate Topic: -----

#1 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Object Identity Crisis

Posted 22 February 2012 - 05:37 AM

In my current gig I occasionally run across a gem when looking through their code. I can't post the actual class, but one example is the User domain object. It looks innocent enough until you open it.

public class User {
    ...
    public String getFirstName() {
        return firstName;
    }
    
    ...
    
    public List<Transaction> getRecentTransactions() {
        return someSoapServiceProxy.getRecentTransactions(userId)
    }
    
    ...
    
    public List<Contact> getAlarmContacts() {
        connection = dataSource.getConnection();
        pstmt = connection.prepareStatement(query);
        ...
        resultSet = pstmt.executeQuery();
        ...
    }
}


So, this "domain" object reaches out (in several places) to a service and to a database. One of many offenses that make me wonder where this company was getting its developers.

Is This A Good Question/Topic? 0
  • +

Replies To: Object Identity Crisis

#2 extremeblueness  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 186
  • Joined: 22-October 12

Re: Object Identity Crisis

Posted 23 October 2012 - 08:03 PM

Well, I suppose it COULD be part of a virus or other related content.

That's pretty much the only direction I see it going, unless it was a bank or something...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1