I want to fix the diversity on my event, help me!

If someone linked you this post is probable you are organizing an event where diversity and inclusivity is an issue and they want to help you fix that. If you want, you can jump to the subsection that better adjust to your case. Remember: diversity is not a TL;DR, you probably need to read the full article to get a better grasp of what you need. As usual: I’m going to focus on the gender gap because it’s easier for me to talk in those terms, but similar strategies can be applied to any other under-represented group.

I was told I have a manel, what’s that?

A manel is a panel full of men (usually white and middle aged). Usually this manel is the main panel or the keynoters panel whose members are the most relevant/the most advertised speakers. They are the display case of your event and they may tell more about your event than you probably suspect.

Bonus track: Have you heard about the Techdel Test?

But I had no women speaker candidates for my event!

It doesn’t matter if it was a set of speakers chosen manually or if you sent a call for papers to the internet waiting for proposals. If you have few (or none) proposals that improve your diversity line-up, something went wrong. Because there are women (and PoC and functionally diverse speakers) out there. You just didn’t met them. But don’t worry, there’s many things you can do to improve it.

Continuar leyendo “I want to fix the diversity on my event, help me!”

How can I get a diverse and inclusive team?

TL;DR: If you are really interested on improving the inclusivity and diversity on your team, you need more than a TL;DR

TL;DR: Ok, there is a video on gvSIG Festival on diversity that cover most of the contents here.

Why do we need inclusivity and diversity?

Do we really need to explain the problem of diversity? IT is mainly white and male. Even the most egalitarian person have biases due to have lived on a non egalitarian world and this reflects on our community. There are also society pressure to some groups of persons not to work on IT.

“True peace is not merely the absence of tension; it is the presence of justice.”

Martin Luther King

In short, diversity should just be a matter of Social Justice.

But if you are looking for more purely economical reasons, recent studies have shown that diverse teams are more efficient and provide more quality outputs [1][2]. This means that even when a company invest explicitly on improve their inclusivity and diversity, the return of investment is usually high. Investing in diversity is a win win situation, but it requires some deconstruction and some effort from all the people involved.

Continuar leyendo “How can I get a diverse and inclusive team?”

Event Listeners Personalizados en Java

Aunque el patrón Observer está implementado nativamente en Java, sometimes we need to make an event management that suits better our needs when using event listeners.

Some context

El problema del manejo de eventos es muy sencillo: Tenemos un objeto que va a ir cambiando de estado. Sin tocar su código, debemos ser capaces de "engancharlo" a otros objetos para que estén pendientes de estos cambios de estado y actúen en consecuencia. Este "enganche" debe poder activarse y desactivarse dinámicamente durante la ejecución.

To implement it we will use a static object, a class and an interface. The static object will be responsible for ensuring the relationships between observers and observables. It will also notify relevant changes to the objects concerned. To pass information during an event we use that class. The interfaces will make the distinction between objects observed and observable objects and any other objects on the application.

A real example

But the best way to see how event listeners works is through an example:

Las instancias de la clase MyCustomEvent serán las que porten la información de un observado a un observable cuando se produzca un evento. Esta clase deberá contener toda la información necesaria sobre ese evento. Por ejemplo, si el evento fuera un click del ratón, esta clase debería llevar datos tales como: coordenadas en la pantalla o el número de clicks. En concreto, nuestra clase de evento sólo contiene el objeto original que lanzó el evento.

import java.util.EventObject;
import java.util.LinkedList;
import java.util.List;

public class MyCustomEvent extends EventObject {

  private static final long serialVersionUID = 7383182229898306240L;

  private final MyCustomListener source;

  public MyCustomEvent (MyCustomListener OriginalSource) {
    super (OriginalSource);
    this.source = OriginalSource;
  }

 MyCustomListener public getSource () {
    this.source return;
  }
}

The static object that keeps the relations between observers and observables is MyCustomEventHandler. It is very important to use synchronization methods to avoid concurrency issues in multithreaded applications:

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MyCustomEventHandler {
  private static final Log log = LogFactory.getLog(MyCustomEventHandler.class);

  private static Map <MyCustomListener, Set > = new LinkedHashMap observable <MyCustomListener, Set > ();

  public static void fire (MyCustomEvent event) {
    log.trace ("fire (" + event + ")");
    try {
      Observers = getRemarks September (source);
      if (Observers! = null) {
        for (final MyCustomListener pl: Observers) {
          try {
            pl.fire (event);
          } catch (Throwable t) {
            log.error (t, t);
          }
        }
      }
    } catch (Throwable t) {
      log.error (t, t);
    }
  } 

  private static synchronized September getRemarks (MyCustomListener source) {
    observables.get return (source);
  }

/ **
* Register to watch to alert you when observable change
*
* @ Param observer
* @ Param observable
* /
  public static synchronized void register (MyCustomListener observer, MyCustomListener observable) {
    Observers getRemarks September = (observable);
    if (null == observers) {
      observers = new HashSet();
    }
    observers.add(observer);
    observables.put(observable, Observers);
  }

/ **
* Deregister not become observers to alert you when observable
* Modify
*
* @ Param observer
* @ Param observable
* /
  public static synchronized void deregister (MyCustomListener observer, MyCustomListener observable) {
    Observers getRemarks September = (observable);
    if (null == Observers) {
      Observers = new HashSet ();
    }
    observers.remove (observer);
    observables.put (observable, Observers);
  }
}

Tanto los objetos observables como los objetos observadores tienen que implementar la interfaz MyCustomListener. Esta interfaz obliga a implementar el método fire(MyCustomEvent event) . En los observables, esta función será la encargada de llamar a MyCustomEventHandler. En los observadores, esta función será llamada cuando se lance un evento de su objeto observado.

Actually, it would be convenient to separate the interface into two: one for observers and another for observables. If an object wants to be both observer and observed, it may have problems with this system. But for simplicity for the example we have chosen this implementation.

import java.util.EventListener;

public interface extends EventListener {MyCustomListener
  public void fire (MyCustomEvent event);
}

Si quisiéramos tener diferentes tipos de eventos (parecido a como funciona el MouseListener), lo único que necesitaríamos es ampliar la interfaz MyCustomListener con todas las funcionalidades que queremos que tenga:

import java.util.EventListener;

public interface MyCustomListener extends EventListener {
  public void fireObjectRecycled (MyCustomEvent event);
  public void fireObjectRefreshed (MyCustomEvent event);
  public void fireObjectUpdated (MyCustomEvent event);
}

Así mismo, podríamos usar diferentes clases derivadas de MyCustomEvent para cada una de estas funcionalidades.

We have to modify the static object MyCustomEventHandler to launch the different events.

Referencias: Hilo donde se discute este tipo de implementación de Event Handler