Presentation is loading. Please wait.

Presentation is loading. Please wait.

CreditCardManagementHost Design patterns John Lin.

Similar presentations


Presentation on theme: "CreditCardManagementHost Design patterns John Lin."— Presentation transcript:

1 CreditCardManagementHost Design patterns John Lin

2 CreditCardManagementHost  Java based – run on any Java enabled systems  Standalone application  Potential to port to the web  Very flexible and easily extended  Who is it for? anyone who uses and keep tracks of their credit cards

3 CreditCardManagementHost  On average, people carry at least three credit cards: Discover, AMEX, Visa/Master  Credit cards offer various incentives: cash rebates, discounts, travel vouchers, 0% APR  Credit cards all have different due dates  In a lifetime, a person may own at least 10 different cards – how to manage them?  Credit Card Management tool!  Not a redesign, new application from scratch with flexibility, reusability, and extensibility in mind

4 CreditCardManagementHost  Provides easier, more efficient administration and management of one or more credit cards belonging to one person  Users can keep track of their monthly payments online, and avoid missed or redundant payments  Users can keep track of their 0% balance transfers and the 0% expiration date. After that date, the transferred amount will be incurring high interests  Users can keep track of their rewards, how many points or cash they have accumulated and used  Statistical credit card usage analysis can also be performed  Reminders/alerts and notes can be attached anywhere

5 CreditCardManagementHost  CreditCardMangementHost is a host with a list of services/plug-ins, like the ones described. This list of services can be extended indefinitely, thanks to decorators  Parent may have access to a child’s card, but not vice versa. Similarly, people may have different access rights to services. Different proxies to that person for that card solve it all!! No matter how many different roles.  Credit cards offers competitive incentives continuously, offering all sorts of rewards – how to keep track of all these differences CONTINUOUSLY? Composites of category and subcategory rids all  Any kinds of analysis can be added with only a new command!! Extensibility or what?  Patterns used: composite, state, decorator, façade, bridge, iterator, visitors, command, proxy, observer, mediator, factory, abstract factory, singleton, prototype, strategy, builder, template, chains of responsibilities, and security patterns

6 CreditCardManagementHost Utilizing mvc: blue: model, yellow: view, green: controller, violate: java packages Overview: host with extendable services

7 CreditCardManagementHost State: there are four states for a credit card when a payment is made. NoPaymentDue, Unpaid, PartiallyPaid, and FullyPaid-in that order. Here, the amount paid and the balance due is passed to a state, then each state will verify itself until the right conditions are met. That will be the payment status! Command and Visitor combination: a command that takes a visitor as the receiver. When execute is called, the visitor will do its thing by visiting the iteratee and perform needed functions. The strategy of the visitors may vary, depending on the needs; very reusable. The Command is send through an internal iterator. If another action is needed, just send in a new command!

8 CreditCardManagementHost  [right] Bridge: ContentHolder is a all purpose data holder. Any collection types can be substituted at later time, without changing much of the code! ContentHolder has a createIterator, which is part of the iterator pattern.  Iterator: this iterator extends java.util.iterator, which means any of the java collections can be iterated, including any of the collection in ContentHolder.  CompositeIterator: iterator for the composites  NullIterator: iterator for the leaf in the composite pattern  BottomLine: Bridge and Iterator combined, one can change any underlying storage schemes and to iterate them without much change!!

9 CreditCardManagementHost o Abstract factory: cardFactory, which manufactures CredittCardFactory, and potential factories for other cards in the future. o Factory: CreditCardFactory that clones a product: creditCard. Potentially, expanding the product line to other credit cards of other countries. o Singleton: both factory and abstract factories are singletons! Only one instance is needed to be resource efficient. o Prototype: products from factories are not created anew, but cloned!! All products implements Prototype. o Pros: more product can be added later, all I need to do is ask the one and only factory for it! Resource efficient! If the product is complex to setup, the the factory just create it once and use it everywhere! With cloning!!

10 CreditCardManagementHost Decorators: all services decorates core service, a limitless number of services can be provided later on that further decorates. All decorators implements an abstract method: updateAmount, which allows each service to do its servicing recursively!! Template and Façade Combined: A façade facilitates communication Between the model and controller. The template method in this façade make sure that certain events happen before everything else: like activate stored data prior to adding newer ones

11 CreditCardManagementHost  Experiences with design patterns:  Design phase  Much longer to design than without using patterns  Every situation has one best-fit pattern, customizations of patterns may occur  Helps to focus on the relationship between entities, rather than implementation-feasibility  Hard to translate patterns into UML, sometimes  Implementation phase  For some patterns, many more classes are needed; explosion of classes  Can be tedious at times, requires a lot more visualization


Download ppt "CreditCardManagementHost Design patterns John Lin."

Similar presentations


Ads by Google