• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regular CRUD design for a Class Diagram

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm designing architecture for a regular CRUD operation. My questions would be regarding the proper stereotypes, mainly for my APIGateway and DAO classes, which i mapped as <JAX-RS>> and <<EntityManager>> respectively.

I'll attach my draft design.

Could you give your thoughts on that ?

Thanks

question.jpeg
[Thumbnail for question.jpeg]
 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks good to me.  The only thing that snagged my attention: you have named your EntityManager class XYZDAO.  While the literature around the OCMJEA exam seems to favor thinking of EntityManager as the 'way' of doing a Data Access Object, I don't think it needs a different name.  You are using someone's implementation of EntityManager, but you will get it from some factory or constructor, and you'll refer to the class by its interface methods, anyway.

Also, the stereotype is a little redundant there.  Perhaps "interface" is appropriate, but I see why you would want to strongly indicate the role that is played by this thing.  Perhaps you could use a stereotype to indicate the technology that is being leveraged?  After all, anyone could name a class EntityManager.  It's so obvious, I was surprised Hibernate did not use that.

I hope it helps.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your ApiGateway is more of a front controller, your XYZService can be a EJB stateless bean and your XYZDAO is a DAO.

The stereotype will be <<front controller>>, <<stateless EJB>> and <<DAO>>

The EntityManager is something you use/instantiate inside the DAO to do CRUD.
 
Eusebio Floriano
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It makes sense what you both said, that XYZDAO has a EntityManager rather than is a.

But i'm still confused with Foster's comment:

The stereotype will be <<front controller>>, <<stateless EJB>> and <<DAO>>  



As 'Front Controller' and 'DAO' are patterns, shouldn't the service class be stereotyped as <<Business Service>>, for example ?

Thanks in advance, guys.
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You meant my comment.

Stereotypes can be patterns because a pattern can represent a set (multiple) of classes. For example DAO pattern normally has an interface and its implementation. You can surely have 2 classes: 1 interface and the other a class. When the stereotype <<DAO>> is used, that tells people both the interface and its implementation are together.

I will recommend naming your classes and their stereotypes with something meaningful. Java EE tech terms (like JSF, managed bean, EJB, servlet, JSP etc), pattern names, POJO, entity, utility are easily understood.
reply
    Bookmark Topic Watch Topic
  • New Topic