Class ArticleViewFacade

java.lang.Object
de.calamanari.pk.facade.article.ArticleViewFacade

public class ArticleViewFacade
extends java.lang.Object
Article View Facade- a FACADE for article management, with restricted access (read-only) and extended by an option to get the mark down price.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    ArticleViewFacade​(ArticleManager articleManager, ArticleHistory articleHistory)
    Creates a new facade connected to the manager and the history.
  • Method Summary

    Modifier and Type Method Description
    Article findArticleById​(java.lang.String articleId)
    Returns the corresponding article for the given id
    double getMarkDownPrice​(java.lang.String articleId)
    Returns the current markdown price for the specified article, if and only if the markdown price is greater than current price

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArticleViewFacade

      public ArticleViewFacade​(ArticleManager articleManager, ArticleHistory articleHistory)
      Creates a new facade connected to the manager and the history.
      Parameters:
      articleManager - manager instance for accessing articles
      articleHistory - history system reference
  • Method Details

    • findArticleById

      public Article findArticleById​(java.lang.String articleId)
      Returns the corresponding article for the given id
      Parameters:
      articleId - identifier
      Returns:
      found article or null if not found
    • getMarkDownPrice

      public double getMarkDownPrice​(java.lang.String articleId)
      Returns the current markdown price for the specified article, if and only if the markdown price is greater than current price
      Parameters:
      articleId - identifier
      Returns:
      current mark down price or -1 to indicate unknown