> > I have a facade that publishes a method that contracts to return a
> > list of categories ordered alphabetically
>
> All problems in computer science can be solved by another layer of
> abstraction. Sure you can't fit a Proxy to a Service in there?
>
>
Hmm an oldie but goodie we can discuss software analysis and design if you
like
but it's a bit OT.


> [snip]
>


> What does that "custom tag" do? A beer says it sorts something. Or,
> maybe you have some silly client-side process that sorts the entries
> after they are loaded into the browser.
>

Well I quite like Wadworth 6X I'll give you my paypal account address and
you can deposit £3.30 :-))
I can assure you I'm quite familiar with my own code and no secondary sort
is going on.

As succinctly as possible

MySQL returns results sorted by primary key by default AFAIAA
no explicit sorting is done in the database access code

/* Category server (database access) */
public List<Category> getCategories(Connection conn) throws
CategoryServerException{
String sql = "select * from Category";

populate list then return it NO SORTING

/* facade deals with transactional connections etc*/
public List<Category> getAllCategories() throws CategoryException
CategoryServer categories = new CategoryServer();
allcats = categories.getCategories(conn);
Collections.sort(allcats);

/* Initialization servlet */
CategoryFacade cats = new CategoryFacade();
List<Category> categories = cats.getAllCategories();
getServletContext().setAttribute(WebConstants.ALPHACATS, categories);

/* CategoryWriter custom tag */
List<Category> cats =(List<Category>)
pageContext.getServletContext().getAttribute(WebConstants.ALPHACATS);
Iterator<Category> iter = cats.iterator();
Category c = null;
StringBuffer buf = new StringBuffer();
     while(iter.hasNext()){
           //build the output
//output it

That's it, really, there is no more

I need to get to the bottom of this as it's bugging the hell out of me
a pound to a penny says it's something simple/stupid. I'll try what you
suggest re wrapping the collection

Thanks

Lyallex

Reply via email to