A former Coast Guard commander who is a prospective candidate to lead the Department of Homeland Security said Wednesday it was "oversimplistic" to build a fence or add more border control agents to prevent illegal immigration from Mexico.

Speaking at a Senate committee hearing on the future of the Department of Homeland Security, retired Admiral Thad Allen advocated for a more complex approach to border security that moved away from two of the main remedies that are often discussed in Congress.

"Not every part of the border is the same," Allen said, "and boots on the ground and fences are not the way to control the border."

Allen's name is often mentioned as a potential replacement for outgoing DHS Secretary Janet Napolitano. Indeed, former Democratic Rep. Jane Harman, also speaking on the Senate Homeland Security panel Wednesday, recommended in her testimony that Obama nominate Allen to the post.

But Allen's critique of immigration reform efforts puts him at odds with a Congress that will ultimately decide his fate, if he is tapped for the job. The office of Immigration and Customs Enforcement falls under the purview of the Department of Homeland Security, and the potential appointee's stance on immigration is sure to undergo strict scrutiny by Republicans who have criticized the agency's handling of border control.

Conservatives have long insisted that the border must be secured before the country addresses the millions of illegal immigrants already inside the U.S., and that often includes calls for a fence between the U.S. and Mexico.

A compromise immigration reform bill that passed the Democratic-controlled Senate earlier this year won bipartisan support partly because it would add 40,000 border patrol agents.

Allen said the problem is more nuanced and requires advanced technologies that allows the federal government to watch over the border and determine which areas present the greatest risk for illegal activity.

"We have to figure out what is the nature of the problem and what is the best way to deal with it with all the tools that we have available, including the aggregation of data on all border functions into a fused picture that senior leaders can take a look at," Allen said. "And I'm talking about all the different license plate reader programs, passenger information, information on private arrivals of aircraft and vessels and so forth, bringing that together and putting that where there can be coherent analysis done against it."