flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Beads and DRY (was Re: [FlexJS] Removing PasswordInputBead has no effect)
Date Tue, 06 Jun 2017 15:03:02 GMT
I agree we have to be concerned about DRY.  Research into optimal patterns
for creating common flavors of beads would be very helpful.  The compiler
might be able to help as well.


On 6/6/17, 6:52 AM, "Josh Tynjala" <joshtynjala@gmail.com> wrote:

>The way that beads work means that we will frequently "violate" DRY, as I
>understand it. FlexJS is designed to have multiple beads that implement
>same thing in different ways. The simplest bead will be designed to be
>never removed and it probably won't include any properties to configure
>behavior. A more complex bead might include some of the same code from the
>simplest bead, but it will also be designed to be removed, but still not
>configured. An even more complex bead will include all three (the core
>feature, removal, and properties to configure). There might even be a
>fourth one that can't be removed, but has properties to configure. Going
>even further, there might even be variations with different subsets of
>properties that can be configured.
>Ideally, we'd find a way to reuse some of the code from the simpler beads.
>It might be possible to subclass them, for instance. However, unless the
>simplest beads are designed for it, reusing their code may not be
>In fact, designing them in a way that they can be extended may violate
>instead because it may require adding code that isn't always needed. In
>that case, there's no option except to repeat some code.
>- Josh
>On Tue, Jun 6, 2017 at 12:02 AM, Justin Mclean <justin@classsoftware.com>
>> Hi,
>> >  Unless something is functionality that you would (virtually) always
>> need, it’s a separate bead.
>> So for CCS we have border, does everyone need borders? Why do we only a
>> sub set of the font attributes included? Some people are not going to
>> all of them or in fact any of them and some other may need other
>> so why are they not seperate?  Not that I think these should be removed
>> into seperate parts. The issue is just about every feature you can name
>> going to optional to someone. So I think we near a clearer definition of
>> what PAYG is.
>> Another example why for instance was flexGrow and flexShrink added in to
>> the CSS code? Shouldn't they be implemented in line with the PAYG
>> in another class? And there are numerous other examples of this. I feel
>> that PAYG is not being applied consistently and seems selective on who
>> making the contribution.
>> > PAYG is already well understood
>> IMO it has not been clearly defined. Alex has described in various ways
>> it size / runtime cost only to move to goal posts. I for one would like
>> clearer definition of it.
>> > All functionality should be implemented as beads when practical. Beads
>> should be as modular as possible with the smallest possible functional
>> What about the cost of violating DRY or the single responsibility
>> principal which two beads do similar things? Is it really OK to add
>> technical debt / penalise users of a new feature when it would be less
>> modifying/improving an existing bead at a much smaller cost? How do you
>> discourage copy paste coding?
>> Thanks,
>> Justin

View raw message