flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: Beads and DRY (was Re: [FlexJS] Removing PasswordInputBead has no effect)
Date Wed, 07 Jun 2017 06:36:06 GMT
That’s not what I’m suggesting at all.

If utility classes (or utility functions) are bloated with lots of functionality then they
are not done right.

Utilities should be reserved for well defined functionality. A good example of this is AnimationUtil.
Imagine you have two animation beads which do different things, they would both use AnimationUtil
for requestFrame and cancelFrame.

The same goes for SolidBorderUtil (which should really be split into two). Any bead which
needs to apply a border just calls the utility.

Bead A supports feature X
Bead B needs to support feature X and Y

feature x used functionality a and b
feature y uses functionality c and d
Create a Util classes a, b, c and d which beads a and b use as needed.

This is obviously not a pattern useful everywhere, but where applicable, has many advantages.


> On Jun 7, 2017, at 4:08 AM, OmPrakash Muppirala <bigosmallm@gmail.com> wrote:
> *Utils approach:*
> Bead A supports feature X
> Bead B needs to support feature X and Y
> Create a Util class called FeatureXAndY

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message