Pablo's profileEl blog de Pablo Castill...BlogLists Tools Help

Blog


    April 03

    Alt.net: buen artículo de la msdn tratando la importancia de las herramientas sobre los conocimientos

     

    Buenas,


    Me gusta la idea de fondo que tiene el artículo de: lo importante son los conocimientos y no las herramientas. Es verdad que, gracias a la herencia dejada por el VB6, en el mundo de MS esos conocimientos no están maduros. Pero por hacer un programa en java no los vas a tener, la herramienta, el java, no te va a dar las buenas prácticas por si sola, es lo que se tiene en la cabeza al abrir el EA, el VS o el Eclipse lo que importa. La cosa es que las empresas, con suerte, se centran en enseñar las herramientas, pero no las ideas abstractas para su buen uso. Al final es lo de siempre, no hay formación, y si la hay quizás no sea la adecuada.


    El artículo:
    Last year David Laribee coined the term "ALT .NET" to describe a coalescing community of like-minded individuals within the larger world of the Microsoft® .NET Framework who felt a growing frustration that Microsoft tooling, guidance, and .NET culture at large did not reflect or support an important set of core values. In October 2007, some hundred-odd souls descended upon Austin, Texas, for the first ALT .NET Open Spaces event, turning the blogosphere buzzword into something more tangible and kicking off the formation of a real community.

    So what is ALT .NET? And how does it differ from the .NET that we already know and love? What are these values that many of us think are missing? What are these alternative tools, techniques, and practices that ALT .NET'ers are espousing? Let's first examine the original tenets of being an ALT .NET developer.

    1. You're the type of developer who uses whatever works while keeping an eye out for a better way. One of the common topics at the ALT .NET event was closing gaps between requirements, testing, and code. There's still fat in the way we develop software that can be eliminated.
    2. You reach outside the mainstream to adopt the best of any community: Open Source, Agile, Java, Ruby. In no way does Microsoft or the .NET community have a monopoly on good software development. For instance, Agile processes and Design Patterns started with Smalltalk. Likewise, Inversion of Control tools and techniques originated in Java. And two fundamental Ruby on Rails principles—Don't Repeat Yourself and Convention over Configuration—are ones that we can adopt in .NET.
    3. You're not content with the status quo. Things can always be more elegant, more mutable, and of higher quality. We're all experimenting with techniques to more closely connect the coding and testing to the business domain. For example, Behavior Driven Development (BDD) refines and extends Test Driven Development (TDD) by specifying the intended behavior of the code in a more readable way than classic xUnit testing. And language-oriented programming has the potential to raise the abstraction layer up to the level of the domain logic.
    4. You realize that tools are great, but they only take you so far. It's the principles and knowledge that really matter. The best tools are those that embed the knowledge and encourage the principles (for example, ReSharper). Furthermore, you feel that the most important qualities of a solution are maintainability and sustainability. Maintainable code means good design. Good design arises from the skillful application of design knowledge. The .NET community has been placing too much focus on learning API and framework details and not enough emphasis on design and coding fundamentals.

    Part of the catalyst for the raising of the ALT .NET banner was a demonstration of a beta of the new Entity Framework in March 2007. I, along with several others, was disappointed at certain elements of the Entity Framework, specifically the lack of "Persistence Ignorance" and the tight coupling to the database. At that time, the Entity Framework did not appear suitable for TDD, Domain Driven Design, or Continuous Design—all things that I consider valuable for maintainable development.

    On the other hand, the new Model View Controller (MVC) Framework for ASP.NET development is exciting because it explicitly supports and enables the values I feel are important for successful software development. The MVC Framework clearly reflects the values of maintainability and testability with an emphasis on Separation of Concerns and testability throughout the design of the Framework.

    It's easy to be cynical or apathetic about the state of development. However, instead of lamenting that Johnny can't code and complaining that it's hard to find good developers to hire, perhaps we should admit our main problem: we're terrible at growing strong developers.

    Many developers would be happy to use Object/Relational Mapping and TDD if they just knew where to start. Likewise, folks already practicing these techniques want to get better by interacting with other practitioners. My chief hope for the ALT .NET movement is that it creates a community that assists both groups, helping them all become strong developers. To that end, the Altnetpedia Web site (altnetpedia.com) has just opened for business with the beginning of a list of resources for learning how to apply these techniques in .NET. The altnetconf message board (tech.groups.yahoo.com/group/altdotnet) is already up and going strong as a place for .NET practitioners to discuss development topics. Stop by!

    April 02

    Como instalar reporting services del sql server 2005 en el windows server 2008

     
    Buenas,
     
    El problema es que no detecta el IIS porque el instalador no detecta el 7. Por lo tanto hay que habilitar toda la compatibilidad con el IIS6 para que el instalador se lo trague.
     
    Este tipo es el que me sacó del problema.
    February 10

    Los yesterdays, ya sé porqué son míticos

    Actuaron antes de mi afición a los carnavales, en todas las retrasmisiones que he visto los han nombrado y la verdad es que tienen la fama merecida.

    Pasodoble a Andalucía.

      

    A las mujeres

      

    Y a la sociedad

      

    Algo bueno tendrán para que los cante Alejandro Sanz

      

     

    Magnífico. Y como sé como funcionan los buscadores, aquí tienen su enlace unos cracks: http://carnaval-tv.es/

    January 27

    15 minutos de lucidez hablando sobre educación

    Habla un juez de menores, que básicamente es quien se come el fracaso de la educación. Una pena que nuestros políticos no tengan las ideas tan claras como este hombre.

    Parte 1:

      

    Parte 2:

      
    January 07

    Los caucus americanos, o como saltarse el aparato de los partidos y elegir a un buen candidato...

    Que envidia tengo de los Caucus, poder elegir el candidato de tu partido, eso si que sería una "renovación democrática" y no las listas cremalleras de ZP.

    Imagináis en el PP poder elegir entre: Gallardon, Rato, Rajoy o vete a saber...

    Imagináis en el PSOE poder elegir entre: ZP, Bono, Solana...

    Creo que si aquí hubiera Caucus seguramente ni ZP ni Rajoy saldrían elegidos, no tienen el más mínimo carisma, pero nos los tenemos que comer por lo "democráticos" que son los partidos políticos.

    ¡¡¡LISTAS ABIERTAS Y PRIMARIAS OBLIGATORIAS YA!!!

    Supongo que no lo harán porque de esta manera mucho inútil de los "aparatos" saldría de la política y fuera de ella... se iría al paro porque no sabe hacer nada en la vida privada.

    December 27

    How to install visual studio 2008 into an xp sp2 with office 2007

     

    Hello everyone,

    I have tried to install vs2008 for two days and now I have done it.

    Go to run and write this:

    msiexec /x {30120000-0044-0C0A-0000-0000000FF1CE}

    It will delete: InfoPath MUI 2007 beta <-- I do not know what is it, but it was stucking the Visual Studio Web Authoring Component installation. What I can say is: I have NEVER installed any Office 2007 beta into my pc.

    Hope this could help someone else.

    Regards.

    June 08

    Aplicación espectacular de la biblioteca británica con Silverlight

     

    Se pueden ver algunos libros que tienen allí, entre ellos de Da Vinci, muy curioso:

    http://ttpdownload.bl.uk/browserapp.xbap

    Que lo disfrutéis.

    April 24

    Cómo crear una búsqueda dinámica con linq, la típica con where dinámico

     

    ¿Cómo se podría hacer con Dlinq el típico formulario de búsqueda por varios campos?

    Muy fácil, se puede formar dinámicamente la consulta, al estilo procedimiento almacenado, pero todo desde Visual Studio, depurando y de una forma directa. Creo que realmente esto es un gran progreso respecto a como se realizaba anteriormente, ahí no hay conexiones, entlib.. ni nada por el estilo, se ataca la base de datos de una forma muy directa.

     

     

     

    Código del botón buscar de la web (los cb son combos y los tb textbox):

    protected void btBuscar_Click(object sender, EventArgs e)
    {
    var q = from p in db.PROYECTOS
    from t in db.TRABAJOS
    from pri in db.PRIORIDADES
    from est in db.ESTADOS
    where p.PROTRABAJO==t.TRAID && p.PROPRIORIDAD==pri.PRIID && p.PROESTADO==est.ESTID
    select new{proexpediente=p.PROEXPEDIENTE,protrabajo=t.TRANOMBRE, prodescripcion=p.PRODESCRIPCION,
    PRIORIDAD=pri.PRINOMBRE,ESTADO=est.ESTNOMBRE,
    CLIID=p.CLIID,PROEXPEDIENTE=p.PROEXPEDIENTE,PRONUMVIVIENDAS=p.PRONUMVIVIENDAS,
    LOCID=p.LOCID,CORID=p.CORID,PROFECHAALTA=p.PROFECHAALTA,PROESTADO=p.PROESTADO,PROID=p.PROID};

    if (cbClientes.SelectedValue != "0")
    {
    q = q.Where(h=> h.CLIID == Convert.ToInt32(cbClientes.SelectedValue));
    }
    if (!string.IsNullOrEmpty(tbExpediente.Text))
    {
    q = q.Where(h=> h.PROEXPEDIENTE == tbExpediente.Text);
    }
    if (tbNumViviendas.Text != "0")
    {
    q = q.Where(h=> h.PRONUMVIVIENDAS == Convert.ToInt32(tbNumViviendas.Text));
    }
    if (cbLocalidades.SelectedValue != "0")
    {
    q = q.Where(h=> h.LOCID == Convert.ToInt32(cbLocalidades.SelectedValue));
    }
    if(cbCoordinador.SelectedValue!="0")
    {
    q = q.Where(h=> h.CORID == Convert.ToInt32(cbCoordinador.SelectedValue));
    }
    if(cbAño.SelectedValue!="0")
    {
    q = q.Where(h=> h.PROFECHAALTA.Year.ToString()== cbAño.SelectedValue);
    }
    if(!chboxIncluirTerminados.Checked)
    {
    q = q.Where(h=> h.PROESTADO != 2);
    }

    GridViewBuscados.DataSource = q;
    GridViewBuscados.DataBind();  <-- Aquí ejecuta la consulta en la BBDD
    }

     

    Todo esto forma un sql muy correcto:

    exec sp_executesql N'SELECT [t0].[PRO_EXPEDIENTE] AS [proexpediente], [t1].[TRA_NOMBRE] AS [protrabajo], [t0].[PRO_DESCRIPCION] AS [prodescripcion], [t2].[PRI_NOMBRE] AS [PRIORIDAD], [t3].[EST_NOMBRE] AS [ESTADO], [t0].[CLI_ID] AS [CLIID], [t0].[PRO_NUM_VIVIENDAS] AS [PRONUMVIVIENDAS], [t0].[LOC_ID] AS [LOCID], [t0].[COR_ID] AS [CORID], [t0].[PRO_FECHA_ALTA] AS [PROFECHAALTA], [t0].[PRO_ESTADO] AS [PROESTADO], [t0].[PRO_ID] AS [PROID]
    FROM [PROYECTOS] AS [t0], [TRABAJOS] AS [t1], [PRIORIDADES] AS [t2], [ESTADOS] AS [t3]
    WHERE ([t0].[PRO_ESTADO] <> @p0) AND ([t0].[PRO_TRABAJO] = [t1].[TRA_ID]) AND ([t0].[PRO_PRIORIDAD] = [t2].[PRI_ID]) AND ([t0].[PRO_ESTADO] = [t3].[EST_ID])',N'@p0 int',@p0=2

     

    El linq realmente va a cambiar la forma de hacer los programas....

    August 18

    WCF (Indigo): si quieres no tienes porqué utilizar un proxy formado a través del wsdl del servicio

    Poco a poco voy conociendo cosas nuevas del Indigo, pero una de las que más me ha gustado ha sido el hecho de no tener que definir un proxy mediante wsdl. La gracia consiste en que compartes la interfaz del servicio a ambos lados de la comunicación y eso queda ya como proxy, no la guarrería que te forma svcutil.

    Esto tampoco es un grandísimo avance, pero hace que los proyectos, y las comunicaciones, queden más limpios y no haya que refrescar los proxys. Por supuesto esto es únicamente útil cuando se controlan los dos puntos de la comunicación, pero en esos casos me parece la mejor opción. Al principio da un poco de cosa no tener la referencia en el proyecto, pero luego te acostumbras :P

    Ejemplo de como quedaría:

    DLL común entre el cliente y el servidor, se referencia a ambos lados de la comunicación:

    namespace Comun
    {
    [ServiceContract()]
    public interface IServicioIndigo
    {
    [OperationContract]
    string MyOperation1(DataSetPrueba ds);
    }
    }

     Servidor que implementa la interfaz (no varía respecto a otro servicio indigo normal)

    public class servicioIndigo : Comun.IServicioIndigo
    {
    public string MyOperation1(DataSetPrueba ds)
    {
    return "Hello: "
    }
    }

    Cliente (aquí hay alguna pijada):

    class PruebaEnCliente
    {
    public PruebaEnCliente()
    {
    ChannelFactory<IServicioIndigo> cf =new ChannelFactory<IServicioIndigo>("ep");

    IServicioIndigo isic = cf.CreateChannel();

    using (isic as IDisposable )
    {
    DataSetPrueba dsp =new DataSetPrueba();

    ClaseComun cm = new ClaseComun(dsp);

    Console.WriteLine(isic.MyOperation1(dsp));
    }
    }
    }

    Por cierto, me dí cuenta de esto buscando como pasar un dataset tipado del servidor al cliente y que mantenga el tipo exacto, no te forme el global::blablabla. También descubrí que svcutil /r: referenciadondeestáeltipo consigue ese efecto, no te forma el tipo global y le tienes que pasar la dll que lo contenga al cliente.

    Pues nada, espero que a alguien le parezca interesante.

    August 17

    Presentación

    Buenas,

    Simplemente quiero presentar mi blog. Tratará cosas técnicas, unas veces en español y otras en inglés para que haya un montón de gente que pueda criticar, para bien o para mal, las cosas que escriba.

    Pues nada, ¡saludos!