<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simon Martinelli on Medium]]></title>
        <description><![CDATA[Stories by Simon Martinelli on Medium]]></description>
        <link>https://medium.com/@simon.martinelli?source=rss-b5526c16f99d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4waOHpAUQt1-y8AiSAMBNA.jpeg</url>
            <title>Stories by Simon Martinelli on Medium</title>
            <link>https://medium.com/@simon.martinelli?source=rss-b5526c16f99d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:09:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simon.martinelli/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CQRS Meets Modern Java]]></title>
            <link>https://medium.com/@simon.martinelli/cqrs-meets-modern-java-85dfe241848c?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/85dfe241848c</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cqrs]]></category>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 17:08:39 GMT</pubDate>
            <atom:updated>2025-01-28T17:08:39.541Z</atom:updated>
            <content:encoded><![CDATA[<p>Developing robust yet maintainable software solutions remains at the heart of modern software development. The Command Query Responsibility Segregation (CQRS) pattern offers an efficient method by creating a clear separation between executing commands and querying data, simplifying the system architecture and improving performance. At the same time, the Data-Oriented Programming (DOP) approach strongly focuses on efficiently handling data. This article shows how integrating CQRS and DOP leads to more robust, scalable, and easier-to-maintain systems.</p><h3>Introduction to CQRS</h3><p>Command Query Responsibility Segregation (CQRS) is a pattern first described by Greg Young [1]. It is based on the principle of separation of responsibilities. It goes back to the Command-Query Separation (CQS) principle introduced initially by Bertrand Meyer in his book “Object-Oriented Software Construction.” While CQS states that methods should either be commands that change the state of an object but do not return a value or queries that return a value but do not change the state, CQRS extends this principle to the architectural level of software applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*eci4EkfK0AClSX6g.png" /></figure><p>CQRS separates the responsibility for processing commands that change a system’s state from the responsibility for querying information about this state. This separation enables an optimized design of both areas of responsibility, which can lead to better structuring. By modeling commands and queries separately, developers can implement more complex business logic more clearly and easily.</p><p>However, introducing CQRS into a system can increase its complexity because two separate models have to be managed. However, as we will see in the article, this apparent disadvantage can also be a great advantage regarding data queries and performance. It can also lead to easier maintainability because changes to the query functionality can be made independently of the command logic and vice versa. In addition, the separation enables optimized scaling because read and write operations place different demands on system resources and can, therefore, be scaled independently. It is important to note that this is irrelevant for many business applications because the number of users and user behavior is known in advance.</p><h3>Data-Oriented Programming</h3><p>Data-oriented programming (DOP) is a paradigm that offers an alternative approach to traditional object-oriented programming (OOP) by focusing on the data and its structures rather than the objects and their behavior. The key concepts of DOP are:</p><ol><li><strong>Immutability</strong><br>Data structures are immutable, meaning they cannot be changed once created.</li><li><strong>Separation of identity and state</strong><br>In DOP, a data item’s identity is separated from its state. This means that an object’s state at a given point in time is simply a snapshot of its data, making its history and changes over time easier to understand.</li><li><strong>Data modeling as a central design element</strong><br>In contrast to OOP, which focuses on objects’ behavior and methods, DOP focuses on the design of the data models. This leads to a clear structuring of the data and makes data manipulation and querying easier.</li></ol><p>In his article [2], Brian Goetz discusses the implementation of DOP in Java and describes how the combination of the new Java features, records, sealed classes, and pattern matching supports the DOP principles and leads to more precise, readable, and reliable programs. In particular, the commands from CQRS are modeled according to Brian Goetz’s ideas.</p><h3>Modern Java Features</h3><p>ava has introduced several significant new language features in recent versions that significantly affect how developers write and structure code. The new features important for this article are records, sealed classes, and pattern matching, described below.</p><p>Records were introduced in Java 16 as a preview feature and have been integral to the language since Java 17. Records are a special class type used to model simple data structures, so-called data carriers, with minimal code. A record automatically creates all fields as final and generates getters, but without a get prefix, for these fields, as well as appropriate implementations of equals(), hashCode(), and toString(). Records are, therefore, ideal for modeling immutable data objects and significantly reduce the amount of code to be written.</p><p>Sealed classes were officially introduced in Java 17 and offered a way to restrict inheritance. A developer can explicitly control which other classes or interfaces can inherit from this type by sealing a class or interface. This is achieved by the sealed keyword and the permitted keywords, which specify the exact types allowed to inherit from the sealed class. Sealed classes promote more precise control over inheritance and enable developers to define and secure hierarchical-type systems more precisely, which is particularly useful in domain modeling.</p><p>Pattern matching for the instanceof operator was introduced in Java 16 as a preview feature and has been further developed. It enables a more compact and readable way of performing type queries and subsequent type conversions. With pattern matching, you can not only check in an if and now but also with a switch statement or expression whether an object belongs to a specific type, but if there is a match, convert it directly to a local variable of the corresponding type. This simplifies the code by removing the need to perform an explicit type conversion in a separate step and thus reduces the error rate when handling type conversions. Finally, Java 21 also adds record patterns, which allow direct access to individual components of a record.</p><h3>CQRS Commands with modern Java</h3><p>To illustrate the integration of CQRS with modern Java and the new features mentioned above, we will focus on the commands. An example is a web shop that offers standard functions such as “Create order,” “Add item,” and “Change quantity.” In a traditional approach, REST interfaces would be created, allowing the order to be made and changed. Listing 1 shows an implementation that I often encounter in practice. The entire order is always transferred, regardless of which data has changed. The PurchaseOrderDTO is also a one-to-one copy of the PurchaseOrder entity and can, therefore, be easily mapped using a mapper such as ModelMapper or MapStruct.</p><pre>@ResponseStatus(HttpStatus.CREATED)<br>@PostMapping<br>void post(@RequestBody PurchaseOrderDTO purchaseOrderDTO) {<br>    var purchaseOrder = modelMapper.map(purchaseOrderDTO, PurchaseOrder.class);<br>    customerRepository.findById(purchaseOrder.getCustomer().getId()).ifPresent(purchaseOrder::setCustomer);<br>    purchaseOrderRepository.save(purchaseOrder);<br>}<br>@PutMapping(&quot;{id}&quot;)<br>void put(@PathVariable Long id, @RequestBody PurchaseOrderDTO purchaseOrderDTO) {<br>    if (id.equals(purchaseOrderDTO.getId())) {<br>        throw new IllegalArgumentException();<br>    }<br>    var purchaseOrder = modelMapper.map(purchaseOrderDTO, PurchaseOrder.class);<br>    purchaseOrderRepository.save(purchaseOrder);<br>}</pre><p>This design presents several problems. In the put() method, it is unclear which data the interface changes. In addition, too much data is transferred because the entire order is always sent from the client to the server, which is unnecessary in most cases. On the client side, it is unclear which data in the interface object can be changed.</p><p>CQRS helps us solve these problems by sending commands from the client to the server instead of objects. The commands can be derived from the requirements at the beginning of the section: «Create order», «Add item» and «Change quantity». Focusing on commands positively affects understanding the application because it adds semantics to the code.</p><pre>sealed interface OrderCommand permits CreateOrder, AddOrderItem, UpdateQuantity {<br>    record CreateOrder(long customerId) implements OrderCommand {<br>    }<br>    record AddOrderItem(long orderId, long productId, int quantity) implements OrderCommand {<br>    }<br>    <br>    record UpdateQuantity(long orderItemId, int quantity) implements OrderCommand {<br>    }<br>}</pre><p>Since commands are immutable, it is a good idea to model them as Java records (Listing 2). The example uses a sealed interface implemented by all commands to group them and further improve comprehensibility. Thanks to the sealed interface, we can use the switch expression’s exhaustiveness to implement the commands’ handling. Exhaustiveness means that the compiler checks whether all values ​​have been handled. Firstly, this is a significant advantage compared to an if/else if/else construct, and secondly, when you add a new command during further development, you are informed if it is not processed.</p><pre>switch (orderCommand) {<br>    case OrderCommand.CreateOrder(long customerId) -&gt; {<br>        var purchaseOrder = orderService.createOrder(customerId);<br>        return created(...).buildAndExpand(...).toUri()).build();<br>    } case OrderCommand.AddOrderItem(long orderId, long productId, int quantity) -&gt; {<br>        var orderItemRecord = orderService.addItem(orderId, productId, quantity);<br>        return created(...).buildAndExpand(...).toUri()).build();<br>    } case OrderCommand.UpdateQuantity(long orderItemId, int quantity) -&gt; {<br>        orderService.updateQuantity(orderItemId, quantity);<br>        return ok().build();<br>    }<br>}</pre><p>In Listing 3, in addition to the switch expression, you can also see a use case for pattern matching with record patterns. The commands CreateOrder, AddOrderItem, and UpdateQuantity are deconstructed, and the individual fields are passed directly to the OrderService. This example has the advantage that the OrderService has no knowledge of the commands and thus remains independent. The entire source code of the examples can be found in [3].</p><h3>Conclusion</h3><p>Java has been constantly evolving to keep pace with technological changes. In recent versions, Java has introduced several modern language features, such as records, pattern matching, and sealed classes. These extensions not only improve the readability and writeability of the code but also enable more functional programming approaches and improved data modeling that help Java developers write more efficient and expressive programs.<br>The article has shown that using CQRS with the separation of responsibilities makes it easier to understand and maintain and greatly benefits from the new Java language features, especially on the command side of implementation.</p><h3>Links</h3><p>[1] Greg Young (2010): CQRS Documents by Greg Young<br><a href="https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf">https://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf</a><br>[2] Brian Goetz (2022): Data Oriented Programming in Java, InfoQ <a href="https://www.infoq.com/articles/data-oriented-programming-java/">https://www.infoq.com/articles/data-oriented-programming-java/</a><br>[3] <a href="https://github.com/simasch/cqrs-meets-modern-java">https://github.com/simasch/cqrs-meets-modern-java</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85dfe241848c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use URL Query Parameters in JSF]]></title>
            <link>https://medium.com/@simon.martinelli/how-to-use-url-query-parameters-in-jsf-bafd7fa2d632?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bafd7fa2d632</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Thu, 21 Dec 2017 12:58:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:20:04.288Z</atom:updated>
            <content:encoded><![CDATA[<p>I had to access query parameters from a GET request in a JSF page.<br><br>The URL looks like <a href="http://localhost:8080/tel/person=Martinelli">http://localhost:8080/tel/person=Martinelli</a> and this should trigger a search.<br><br>With ViewParam this is very easy to achieve:</p><pre>&lt;f:metadata&gt;<br>    &lt;f:viewParam name=&quot;person&quot; value=&quot;#{searchBean.person}&quot; /&gt;<br>    &lt;f:viewAction action=&quot;#{searchBean.search}&quot;/&gt;<br>&lt;/f:metadata&gt;</pre><p>The viewParam would fill the query parameter person in the property person of the SearchBean JSF backing bean and viewAction will trigger the search action on page load.</p><p>Easy — isn’t it!?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bafd7fa2d632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Camel REST Endpoint and Servlet Name]]></title>
            <link>https://medium.com/@simon.martinelli/apache-camel-rest-endpoint-and-servlet-name-dd827a56716f?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd827a56716f</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Thu, 16 Nov 2017 14:39:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:24.341Z</atom:updated>
            <content:encoded><![CDATA[<p>This problem took me a few hours to solve at my current client.<br><br>Apache Camel provides a way to expose routes as REST endpoints:</p><pre>restConfiguration().component(&quot;servlet&quot;);<br><br>rest(&quot;start&quot;)<br>        .get()<br>        .route().routeId(&quot;esb-parisbridge rest&quot;)<br>        .to(&quot;direct:start&quot;)<br>        .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(200))<br>        .transform(constant(&quot;Completed Request successfully&quot;));</pre><p>Now when you are deploying multiple WARs into one app server the CamelHttpTransportServlet is there multiple times with the same name.</p><p>To make this work you need to rename the servlet name to a unique name:</p><pre>&lt;servlet&gt;<br>    &lt;display-name&gt;Camel Http Transport Servlet&lt;/display-name&gt;<br>    &lt;servlet-name&gt;CamelServletParisBridge&lt;/servlet-name&gt;<br>    &lt;servlet-class&gt;org.apache.camel.component.servlet.CamelHttpTransportServlet&lt;/servlet-class&gt;<br>    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br>&lt;/servlet&gt;<br><br>&lt;servlet-mapping&gt;<br>    &lt;servlet-name&gt;CamelServletParisBridge&lt;/servlet-name&gt;<br>    &lt;url-pattern&gt;/camel/*&lt;/url-pattern&gt;<br>&lt;/servlet-mapping&gt;</pre><p>The problem now is that Camel does not know about the changed name and you will get a 404 not found when trying to access the REST endpoint.</p><p>You must tell the Camel servlet component what the name of the servlet will be:</p><pre>restConfiguration().component(&quot;servlet&quot;)<br>  .endpointProperty(&quot;servletName&quot;, &quot;CamelServletParisBridge&quot;);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd827a56716f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EC2 Container Services: denied: Your Authorization Token has expired. Please run ‘aws ecr get-login’ to fetch a new one.]]></title>
            <link>https://medium.com/@simon.martinelli/aws-ec2-container-services-denied-your-authorization-token-has-expired-please-run-aws-ecr-get-login-8462e3696c4b?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8462e3696c4b</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Sat, 30 Sep 2017 14:11:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:42.792Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I tried to push my docker image to AWS but constantly get the error:<br>denied: Your Authorization Token has expired. Please run ‘aws ecr get-login’ to fetch a new one.<br><br>There seems to be a bug because when I looked at the generated key I saw<br><br>docker login -u AWS -p -e none <a href="https://xxx.dkr.ecr.us-west-2.amazonaws.com/">https://xxx.dkr.ecr.us-west-2.amazonaws.com</a><br><br>The problem is <strong>-e none</strong>.<br><br>If you have the same problem just copy the request and execute it without -e none.<br>That’s it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8462e3696c4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vue.js and Spring Boot — A Perfect Combination]]></title>
            <link>https://medium.com/@simon.martinelli/vue-js-and-spring-boot-a-perfect-combination-2c3e6406aa33?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c3e6406aa33</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Sat, 17 Sep 2016 10:23:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:42.004Z</atom:updated>
            <content:encoded><![CDATA[<p>Last week while working for my client I had the problem that after a deployment not all services were running. We don’t have a monitoring in place because the system isn’t in production right now. So what to do?<br><br>After looking at several monitoring tools I came to the conclusion that there is no easy to use health check tool out there. So I decided to implement a small health checker by myself.<br><br>I call it Simon (funny name, isn’t it :-). Simon stands for SImpleMONitoring. I know it’s more a health checker and not a fully featured monitoring tool but for the sake of the name…<br>Btw. you can find the <a href="https://github.com/simasch/simon">source code on GitHub</a>.</p><h4>The backend</h4><p>I wanted to create a few REST services and some persistence to store the monitoring data.</p><p>First I started with <a href="http://sparkjava.com/">Spark Framework</a> but this wasn’t the right tool. It may be great for fast and small stuff but there is missing to much. So I move to <a href="http://projects.spring.io/spring-boot/">Spring Boot</a>.<br><br>As a Java EE consultant and trainer it took some effort but I realized that Spring Boot is a fantastic framework with so many convenient features.<br><br>What I really like is the default behavior. <br>For example JPA. No data source configuration, no persistence.xml. Just add entities and define your JDBC url and Spring Boot know where to store the data. That’s it.</p><pre>spring.datasource.url=jdbc:derby:/var/simon/simondb;create=true</pre><p>The other thing that is great is the <a href="http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready">Spring Boot Actuator</a>.<br>It has everything you need to monitor your application in production and you can hook in you own health check.<br><br>But the most surprising feature that I found is the ability to <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html">generate an executable JAR</a> that can be run as a Linux service.<br><br>By simply adding some configuration to the Spring Boot Maven plugin you get a jar that contains the bash script and all the Java class:</p><pre>org.springframework.boot<br>    spring-boot-maven-plugin<br>    <br>        true</pre><p>Simply put the jar on the Linux box and create a symbolic link in init.d and you are done!</p><p>Now after having my REST services up and running Simon needs a frontend.</p><h4>The Frontend</h4><p>On the start page you see all the servers Simon is checking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*NGVkoGxNNnaB-y8k." /></figure><p>There is also a detail page showing the last results in a graph</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*-N0ROasIh5f32cLJ." /></figure><p>So how to create such an UI?</p><p>I was used to develop web applications with JSF. The good thing about JSF is the great IDE support because of the backing bean. <br>But the days of component based web frameworks are over. These days fully featured JavaScript frameworks Angular and ReactJS are used to create single page applications (SPA).</p><p>But do I really need that? <br>I first had a look at Angular2 and was overwhelmed by the features.</p><p>I’m a quite experienced HTML developer and like to write the HTML code by my self. And for only two pages I didn’t want all the build stuff like npm, bower, gulp, webpack etc. I just wanted to embed my UI into the Spring Boot application.</p><p>After some googleing I found <a href="http://vue.js/">Vue.js</a>. It promises “Reactive Components for Modern Web Interfaces”. Vue.js represents the view model and does exactly what I need.</p><p>I used data binding in the HTML page. To create a table row it looks the HTML looks like this:</p><pre>{{host.name}}<br>  <a href="https://medium.com/%7B%7Bhost.url%7D%7D">{{host.url}}</a><br>  {{host.status}}<br>  <a href="https://medium.com/detail.html?url={{host.url}}">{{host.duration}} ms</a><br>  {{host.timestamp}}</pre><p>There is the mustache syntax and also some directives starting with v-.<br><br>But where comes the data from? you have to create an instance of Vue and add data and functions.<br>That’s it!<br>Vue.js also have some plugins where I used vue resources to get an easy to use http client.</p><pre>(function (exports) {<br>    exports.app = new Vue({<br>        el: &#39;#content&#39;,<br>        data: {<br>            hosts: null,<br>            dataReady: false,<br>            interval: null,<br>            autoRefresh: false,<br>            lastRefresh: null<br>        },<br>        ready: function () {<br>            this.fetchData();<br>        },<br>        methods: {<br>            fetchData: function () {<br>                var vm = this;<br>                this.$http.get(&#39;check/latest&#39;).then(function (response) {<br>                    vm.hosts = response.body;<br>                    vm.lastRefresh = formatTimestamp(new Date());<br>                    vm.dataReady = true;<br>                }, function (response) {<br>                    console.log(response.status);<br>                });<br>            },<br>            switchAutoRefresh: function () {<br>                this.autoRefresh = !this.autoRefresh;<br><br>                if (this.autoRefresh) {<br>                    var vm = this;<br>                    this.interval = setInterval(function () {<br>                        vm.fetchData();<br>                    }, 10000);<br>                } else {<br>                    clearInterval(interval);<br>                }<br>            }<br>        }<br>    });<br>})(window);</pre><h4>Conclusion</h4><p>Spring Boot and Vue.js are both fantastic frameworks with really good documentation. <br>The startup was really fast and I’m very happy with the solution so far.</p><p>With Spring Boot it’s very easy to create fully featured self contained applications.</p><p>Self contained means that they don’t need to be deployed in a application server. So they are easier to install and with the executable jar I even don’t need any additional startup scripts on a Linux box.</p><p>Vue.js brought the missing dynamic stuff to my HTML pages. It is straight forward to use and because of the minimal dependencies you can just add one or two JavaScript files to your application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c3e6406aa33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Send Mails in ASP .NET 5 on Azure]]></title>
            <link>https://medium.com/@simon.martinelli/how-to-send-mails-in-asp-net-5-on-azure-88ad164b6ccb?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/88ad164b6ccb</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Tue, 19 Jan 2016 18:08:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:53.198Z</atom:updated>
            <content:encoded><![CDATA[<p>Unfortunately neither SendGrid nor System.Net.Mail is supported in the actual version of ASP .NET 5 (RC).<br><br>So how to send mails then?<br>One solution is to use MailKit <a href="https://github.com/jstedfast/MailKit">https://github.com/jstedfast/MailKit</a><br><br>To use MailKit just add “MailKit”: “1.3.0-beta5” to your project.json<br><br>What you need is an SMTP server. On Azure you can create a <a href="https://sendgrid.com/">SendGrid </a>account and use the host name and the credentials provided in the Configurations section. SendGrid on Azure is free for up to 25&#39;000 mails per month!<br><br>The code to send a mail is straight forward.<br><br>private void SendEmail()<br>{<br> var message = new MimeMessage();<br> message.From.Add(new MailboxAddress(“Peter Muster”, “peter@muster.ch”));<br> message.To.Add(new MailboxAddress(“Petra Muster”, “petra@muster.ch”));<br> message.Subject = “Some Subject”;<br><br> message.Body = new TextPart(“plain”)<br> {<br> Text = string.Format(@”Hello,<br><br>Just a little message for you”<br> };<br><br> using (var client = new SmtpClient())<br> {<br> client.Connect(“smtp.sendgrid.net”, 587, false);<br> client.AuthenticationMechanisms.Remove(“XOAUTH2”);<br> client.Authenticate(“your_id@azure.com”, “password”);<br><br> client.Send(message);<br> client.Disconnect(true);<br> }<br>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88ad164b6ccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logging in ASP .NET 5 on Azure]]></title>
            <link>https://medium.com/@simon.martinelli/logging-in-asp-net-5-on-azure-caded11f2f1a?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/caded11f2f1a</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Mon, 18 Jan 2016 20:35:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:20:38.414Z</atom:updated>
            <content:encoded><![CDATA[<p>Currently ASP .NET 5 is not able to log on Azure.<br><br>Fortunately there is a workaround described here <a href="https://github.com/aspnet/Home/issues/773">https://github.com/aspnet/Home/issues/773</a><br><br>The trick is to use <a href="http://serilog.net/">Serilog</a> an open source logging framework for the .NET platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caded11f2f1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ASP .NET 5 Continuous Deployment from Visual Studio Online to Azure]]></title>
            <link>https://medium.com/@simon.martinelli/asp-net-5-continuous-deployment-from-visual-studio-online-to-azure-a04129789d29?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a04129789d29</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Tue, 12 Jan 2016 21:31:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:51.175Z</atom:updated>
            <content:encoded><![CDATA[<p>ASP .NET 5 uses DNX and the standard build in Visual Studio Code does not work.<br><br>You have to create your on build as describe in this article:<br><a href="https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5">https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5</a><br><br>But in the tutorial there is missing one important step:<br>In the Visual Studio Build Step you have to <strong>uncheck “Restore NuGet Packages”</strong><br><br>Without this you will get<br><br>##[error]Error parsing solution file at C:\a\1\s\src\simashr\simashr.xproj: Exception has been thrown by the target of an invocation.<br>##[error]Unexpected exit code 1 returned from tool NuGet.exe</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a04129789d29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rules for Programmers and Does the Developers Age Matter]]></title>
            <link>https://medium.com/@simon.martinelli/rules-for-programmers-and-does-the-developers-age-matter-7e7ee9a40a7f?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e7ee9a40a7f</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Fri, 21 Aug 2015 12:11:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:19:46.393Z</atom:updated>
            <content:encoded><![CDATA[<p>I found two very interesting articles.<br><br>The first one (in German) discusses if the age of a developer matters and what the pros and cons are of young or old. <a href="https://jaxenter.de/aeltere-pogrammierer-jugend-versus-erfahrung-16464">https://jaxenter.de/aeltere-pogrammierer-jugend-versus-erfahrung-16464</a><br><br>In the second you will find 11 rules for better code. I completely agree on all 11 rules!<br><a href="http://simpleprogrammer.com/2015/03/16/11-rules-all-programmers-should-live-by/">http://simpleprogrammer.com/2015/03/16/11-rules-all-programmers-should-live-by/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e7ee9a40a7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which parts of Java EE belong to the application server?]]></title>
            <link>https://medium.com/@simon.martinelli/which-parts-of-java-ee-belong-to-the-application-server-fc0b511ab6a1?source=rss-b5526c16f99d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc0b511ab6a1</guid>
            <dc:creator><![CDATA[Simon Martinelli]]></dc:creator>
            <pubDate>Thu, 11 Dec 2014 14:02:00 GMT</pubDate>
            <atom:updated>2017-12-21T13:20:48.342Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday I was at the Developer Day of Swiss Railways.<br><br>Florian Seidl talked about future enterprise software architecture where he doubt that the application still plays a central role in Java EE.<br><br>A lot of people argue that it is a pain to relay on a out dated full blown Java EE application server and therefore use a Spring/Tomcat stack or simply use Spring on top of the application server.<br><br>It seems that there is a problem in how Java EE is defined. In my opinion it would make sense to divide all the Java EE specs in two parts.<br><br>One part should contain all the specs that are directly related to the application server and on the other side there should be the specs where the application code is built on top.<br><br>App server related topics are web containter, threading, JTA, JCA, JAAS, JMS etc.<br>Application related are i.e. JPA, CDI, EJB, JSF.<br><br>The idea behind the separation is that one could update the application related implementations without changing the application server version.<br><br>For example I don’t see any reason for not using JPA 2.1 in a Java EE 5 application server.<br><br>Sure these lists are just a first guess and incomplete but I would be interested what you think.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc0b511ab6a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>