The level of coarseness you use to represent business objects as beans is
one of the engineering decisions involved in using J2EE.  There's no simple 
rule, and your solution may depend on what factors are important to you or 
your clients.  
If you're using CMP, you may be forced into using a bean architecture that
matches your table architecture (unless it is possible to incorporate more
complex joins into CMP.  I don't know, I've only used BMP).  
But with BMP, its your own choice.  The downside of having so much handled
by the container is a lot of performance overhead, so you may decide to make
your beans coarser (for instance, a song bean that incorporates the
methods needed for accessing categories and formats).  This will probably
be faster, but keep in mind that you'll lose some flexibility.  If you 
later want to add a "Search by Category" option or something, it may end 
up being nice to have those Category beans around.
Since you presumably wanted a real answer, here's a thought: Since the 
category and format beans are small and apparently won't change
much, it might be acceptable to model them as beans but keep them in 
memory (use a no passivation container) if you have the memory.  This 
will keep it pretty speedy, and leave you with the benefits of beans.  
You'll have to implement some sort of "isDirty" method though for when the 
categories & formats do change.  
    Mike

On (29/05/01 10:41), Hunter Hillegas wrote:
> I have a few tables:
> 
> songs: song_id, song_name, song_uri, category_id (FK->categories), format_id
> (FK->formats)
> 
> categories: category_id, category_name
> 
> formats: format_id, format_name
> 
> Since each is their own table, I assume that if I want to use entities, I
> need one for each type... Still, when I create a bunch of song beans, isn't
> it a fairly heavyweight solution to create the category and format beans as
> well, especially if most operations are view only (no data is being
> changed)?
> 
> Hunter
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user

-- 
Mike Hoolehan
Sycamore Associates, Inc.
[EMAIL PROTECTED]
301.668.4681x103

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to