Skip to end of metadata
Go to start of metadata

Zend Framework: Zend_Bo Component Proposal

Proposed Component Name Zend_Bo
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Bo
Proposers Yegor Bugayenko
Zend Liaison TBD
Revision 1.0 - Feb 2010: Initial Draft.
1.1 - 24 Feb 2010: Ready for review (wiki revision: 12)

Table of Contents

1. Overview

Zend_Bo is an aggregator of simple business object classes. Very often we need to manipulate with primitive data objects, which are similar in almost all web applications, like date, name, password, email, price, IP address, IBAN bank account, SWIFT code, phone number, etc. There are many business areas where many types of such business objects could be used. The proposed set of Zend_Bo components will provide certain standardization and unification for the operations with said business objects.

We already have Zend_Date, Zend_Currency and some other good classes. But real life web applications need more classes, that will automate routine manipulations with business objects.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will allow to create simple business objects from raw data
  • This component will allow to manipulate with simple business objects

4. Dependencies on Other Framework Components

  • Zend_Date
  • Zend_Currency
  • Zend_Locale
  • Zend_Validate

5. Theory of Operation

There are two steps:

  • To instantiate a business object, e.g. Zend_Bo_Ip with raw data
  • To manipulate with the object

6. Milestones / Tasks

  • Milestone 1: Zend_Bo_Money, Zend_Bo_Ip, Zend_Bo_Name, and Zend_Bo_Email will be designed here
  • Milestone 2: Working prototype checked into the incubator supporting all use cases
  • Milestone 3: Unit tests exist, work, and are checked into SVN.
  • Milestone 4: Initial documentation exists.

7. Class Index

  • Zend_Bo_Money
  • Zend_Bo_Ip
  • Zend_Bo_Email
  • Zend_Bo_Name
  • Zend_Bo_Password
  • Zend_Bo_Country
  • Zend_Bo_City
  • Zend_Bo_Address
  • Zend_Bo_Zip
  • Zend_Bo_Phone
  • Zend_Bo_..

8. Use Cases

Zend_Bo_Money:UC-1
Zend_Bo_Ip:UC-2
Zend_Bo_Name:UC-3
Zend_Bo_Email:UC-4

9. Class Skeletons

Labels:
date date Delete
money money Delete
email email Delete
password password Delete
address address Delete
country country Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 21, 2010

    the idea looks great, but user cases make it somewhat confusing
    at first, it looks like data container (value object of DDD comes to mind, so Zend_ValueObject name makes more sense to me),
    but then I see service layers behind and object behaviour becomes unclear
    for example:

    first you create an IP object with hostname (btw what about IPv4 vs IPv6 ?), then you access it's country property
    but where did that data come from is not clean? I assume some geoip service layer behind

    same with Zend_Bo_Money, it assumes that some currency conversion layer is already in place,
    in prototype is see it as a simple _getRate method, but what if I wish to use some conversion API, or currency rates from local DB

    so to me it looks good as a data container, because there are many things you can present as a standard container,
    but service layer raises a lot of questions like: DI, service interface class etc

    sorry for a long comment

    1. Feb 21, 2010

      Denis, thanks for your comments. You're right, every business object (BO) will have its own implementation and its own subsidiary layers, which will be responsible for data manipulation. I didn't specify them in the skeleton, since the proposal is about Zend_Bo component at first. Once it's approved, every BO will be discussed individually. This was my plan. For example:

      Zend_Bo_Money will implement:

      • rates conversion by different converters, like xe.com, oanda.com, etc.
      • using pre-defined rates, from DB, files, INI, etc.
      • caching of conversion requests, with Zend_Cache
      • configuration of precision (cents, 1/100 cents, 1/10000 cents, etc)

      Zend_Bo_Ip will implement:

      • getting location information, with geoIP, or other provider
      • IPv4, IPv6 with one unified interface
      • validation of IP address/port (ping, port check, etc.)
      • getting metrics of the address (traceroute, ping, etc)

      Not all applications need these functions, but this is the benefit of Zend_Bo component - you get a simple business object with a very powerful functionality behind. Now, as I understand, the point is to approve the entire idea of Zend_Bo, and then continue with discussions on specific business objects.

  2. Feb 07, 2011

    Archiving this proposal, feel free to recover it when you want to work on it again. For more details see this email.