mardi 15 décembre 2015

Which Design Pattern to use Java

Good morning in my timezone.

I have the following WebServices implemented using EJB 3.0 (@WebService).

@Stateless(...)
@WebService(..)
public class WebSerb1

@Stateless(...)
@WebService(..)
public class WebSerb2

@Stateless(...)
@WebService(..)
public class WebSerb3

@Stateless(...)
@WebService(..)
public class WebSerb4

Each webService has an method called refreshData(), at the end of the method there is a flag named "dirty" that needs to be updated on the database,each webservice as a different database table ("web1","web2","web3","web4"). I need a code in the end of the method that verifies if all the dirty flags of all four tables are false to make some actions. Which is the best way to implement this code?

The easy way is to all webservice extends from an abstract class , and this abstract class has a method that verifies those all four table (through JPA), the problem with this implementation is if there is a fifth table we have to add this table to this method.

Aucun commentaire:

Enregistrer un commentaire