Archive for the ‘Uncategorized’ Category
To All Startups (in Brussels)
Bootstrapping is hard. You know it. I know it. We all know it.
Kodesk is still on tracks but it’s taking much more time and effort to get to an “investable” state than we expected. So it’s time for a little bit of creativity.
What I need is a part-time job that keeps me involved in the startup community while paying the bills, filling the fridge, and still leaves me with enough time to work on Kodesk.
What you might need is an iPhone/iPad developer with an entrepreneur mindset, who is not too expensive and can work alongside with you as your business matures, without any long-term commitment or fixed-price contract.
So here is my proposition to you.
From January 2012 onward, I’m offering my iPhone/iPad development services for 400€ a day, up to 3 days a week. If a startup needs me 3 days a week, I’ll work with one startup. If 3 startups need me for 1 day a week each, I’ll work for 3 startups. You get my point.
A few points for clarification:
- This offer is limited to startup companies only, which means innovative companies who have not reached break-even yet. If your company doesn’t fit that description and you need my services, I will apply my standard daily rate (600€/day)
- What I mean by iPhone/iPad development is mostly native app development. I can possibly help you with with mobile web development too, but I’ll do my best to dissuade you to go that route because of integration and usability issues.
- This is a contracting offer. I’m not interesting in you hiring me as an employee, as it makes it more complex for both you and me, more risky for you and less flexible for me.
- I can help you more than 3 days a week on a specific period of time but I’ll have to make up for it and I would like it to stay an exception.
- I’m not a designer myself but I can implement someone else’s design. That said, most of the time, for the first application of a startup, there’s not a lot of design required as we can mostly use the default styling with some customization.
- I have very flexible terms, you can try me out for a few days, and once you are convinced, we can sign a monthly contract. I send you my bills at the end of each month, and all I require is to be paid with 15 days after you receive the bill.
- I’m really here to help you and accompany you in a partnership relationship. I’m not interested in client/provider relationships, chasing after payments and all that. If the relationship goes bad, I don’t renew my contract and I’m done. And I’ll ask for your financial status before I start to work.
- Whatever happens, the source code for everything I do will be stored in a location you can access and I’ll do my best so that you can take over the development with your own employees or other contractors at any time.
- I can also help you with app mock-ups, App Store set up and publishing, I can even train you about iOS development so that you can easily take over what I do.
- I’d rather work in person with startups in Brussels and the surrounding area, but working remotely over Skype can be discussed.
- Given my short experience as an entrepreneur myself, I can also help you with discussions about your business model (I love lean startups).
- Of course, I have already developed a few iPhone apps, including 2 that are on the app store (MooPlan and ConferenceGuide), and 2 private ones that I can show you if you want. But the best way to test my skills is definitely to try me out for a few days.
- Last but not least, if you have nothing developed yet, not even on the backend side, I can help you with technology choices and development there too. I’m not a Ruby-on-Rails or Python developer, I have done some PHP development but I hate it. I can talk to you about Groovy and Grails, the technology stack I chose for Kodesk and the great advantages it has in terms of scalability, productivity and ease to find developers.
So if you are interested in this offer and you want to know more, feel free to contact me at [email protected] or leave an open questions in the comments below.
I’m Really Pissed at Apple Right Now!
Yes, you read that right! Me, the Apple fanboy, the Mac addict. Let me tell you a story.
About 5 years ago, when I was still working for Axen, I was offered an ugly heavy PC laptop as a part of my salary package. Given the price of the beast and the fact that I was quite an Apple admirer already, I proposed my boss to switch to Macbook Pros instead. And since it wouldn’t cost that much and it would potentially impact recruitment attractiveness in a very positive way, we did it. After a year of negotiation with providers, process development and all that, the big day finally arrived.
And within months, more than half of Axen consultants had wonderful 17-inch macbook pros, including me of course.
That was my first mac and I loved everything about it. But one day, the laptop started to shut down without warning. And a couple of days later, I noticed the laptop was not physically stable anymore. I turned it upside down and I saw the battery had swollen. A few Google searches later, I quickly removed the battery as the next step was likely to be explosion. I called AppleCare and they told me that the battery was not under extended warranty but since it was a factory defect, they were willing to change it exceptionally for free. They gave me a support ticket number, I went to the closest Macline and they changed it alright. That was back in 2009.
Fast forward to today. When I left Axen, the laptop was still working great but I needed more power, so I got myself one of the new Unibody ones, and I gave the old one away to my mother. She was also very happy about it and then a couple of weeks ago, she noticed the trackpad button was not working anymore and she showed me this on the webcam:
What the f…!!! I thought they had solved this swollen battery already. Actually I hoped so because with the unibody one, if it starts to swell, it will break everything inside.
Anyway, I gave her the number of AppleCare. The laptop is more than 3 years old but the battery is not covered by AppleCare anyway. And this is clearly yet another dangerous factory defect. She called… and she was turned down. Apparently the guy on the phone was not friendly at all, he said that it was normal after some time, he gave her a 30-euro discount on a new battery (which costs 139 euros, just for the record) and hung up. She told me that, I told her it was not normal at all. What is normal is for the battery to lose autonomy, not to swell to the limit of explosion. So she called back, explained that she had seen a lot of cases on the web, that it was definitely not normal and even dangerous, but they wouldn’t listen. “Take your 30 euros and get a life” is basically what they answered.
Now I’m an Apple fanboy because they build awesome products. But also because their products have proven to be very reliable. And even when there is a problem (shit happens…), they have excellent customer support… usually. But what they are doing here is really pissing me off. Apple, if you are listening…
Grails, Vaadin and Spring Security Core
I got kind of bored with Flex and all the complexity it introduces by forcing you to switch between ActionScript and whatever you are using for the backend (Groovy in my case). I also got bored with having to regenerate my data service stubs on each server-side change, and having to handle the asynchronous remoting. So I started to have a look at Vaadin.
Vaadin offers the same richness of components as Flex, but I can code my UI with Groovy and it completely removes the need to bother about remoting and all that stuff. It’s really like my old Swing days and I love it.
Last week-end, I tried their AddressBook tutorial, and I adapted it to Grails using the Grails-Vaadin plugin. Then I modified the sample so that it uses GORM to store contacts. And finally I installed spring-security-core plugin to secure my business services with @Secured annotations. And it worked absolutely great.
I just released a new version of the Grails-Vaadin plugin with Vaadin upgraded to 6.5.1 (the latest version at this point), and I uploaded my version of addressbook to GitHub.
For me, the most interesting part is how I got security to work. All I had to do was to install spring-security-core plugin into grails and then define a simple SecurityService like the following:
package org.epseelon.addressbook.business
import org.springframework.security.core.context.SecurityContextHolder as SCH
import org.springframework.security.authentication.BadCredentialsException
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
class SecurityService {
static transactional = true
def springSecurityService
def authenticationManager
void signIn(String username, String password) {
try {
def authentication = new UsernamePasswordAuthenticationToken(username, password)
SCH.context.authentication = authenticationManager.authenticate(authentication)
} catch (BadCredentialsException e) {
throw new SecurityException("Invalid username/password")
}
}
void signOut(){
SCH.context.authentication = null
}
boolean isSignedIn(){
return springSecurityService.isLoggedIn()
}
}
Then I injected this SecurityService into my AddressBookApplication and used it:
class AddressBookApplication extends Application {
private SecurityService security = (SecurityService)getBean(SecurityService)
[...]
boolean login(String username, String password) {
try {
security.signIn(username, password)
refreshToolbar()
return true
} catch (SecurityServiceException e) {
getMainWindow().showNotification(e.message, Notification.TYPE_ERROR_MESSAGE);
return false
}
}
}
Then whenever I try to call a @Secured method:
package org.epseelon.addressbook.business
import org.epseelon.addressbook.dto.PersonListItem
import org.epseelon.addressbook.domain.Person
import grails.plugins.springsecurity.Secured
class PersonService {
static transactional = true
[...]
@Secured(["ROLE_USER"])
PersonListItem updatePerson(PersonListItem item) {
Person p = Person.get(item.id)
if(p){
p.firstName = item.firstName
p.lastName = item.lastName
p.email = item.email
p.phoneNumber = item.phoneNumber
p.streetAddress = item.streetAddress
p.postalCode = item.postalCode
p.city = item.city
p.save()
return new PersonListItem(
firstName: p.firstName,
lastName: p.lastName,
email: p.email,
phoneNumber: p.phoneNumber,
streetAddress: p.streetAddress,
postalCode: p.postalCode,
city: p.city
)
}
return null
}
}
If I’m not logged in as a user, I get an “access denied” exception:
package org.epseelon.addressbook.presentation.data
import com.vaadin.data.util.BeanItemContainer
import org.epseelon.addressbook.dto.PersonListItem
import org.epseelon.addressbook.business.PersonService
import com.vaadin.data.util.BeanItem
import com.vaadin.ui.Window.Notification
import org.epseelon.addressbook.presentation.AddressBookApplication
/**
*
* @author sarbogast
* @version 19/02/11, 11:12
*/
class PersonContainer extends BeanItemContainer<PersonListItem> implements Serializable {
[...]
boolean updateItem(Object itemId) {
try {
personService.updatePerson((PersonListItem) itemId)
return true
} catch (Exception e) {
AddressBookApplication.application.getMainWindow().showNotification(
e.message,
Notification.TYPE_ERROR_MESSAGE
);
return false
}
}
}
To see what it looks like, all you have to do is to download the code from GitHub, and run “grails run-app” at the root of it.
If you try to create a new contact of edit an existing one and save it without being logged in, you get an “access denied” message. But if you login as ramon/password, it works.
Note that this project uses Grails 1.3.6 but the plugin supports any version of Grails above 3.2 included. As always, your feedback is more than welcome.
My Case for DTO’s
In many of my posts about Grails and Flex integration, I take for granted that I use Data Transfer Objects to transfer data between my Grails backend and my Flex frontend. Put simply, Data Transfer Object are pure data containing classes different from the domain entity classes used to store data in the backend. I take it for granted because I’m deeply convinced that it’s the best way to do things and so far, experience has never proved me wrong. But I often get this question in comments or by mail (this is for you Martijn): why bother create an entirely separate class structure and copy data from entities to DTO’s and back instead of just using entities?
I’ve expressed my arguments a couple of times across various posts but I thought it would be nice to sum things up in here for future reference.
Where does it come from?
When I first started to work on enterprise applications and ORM-based architectures, it was with a Model-Driven Architecture framework called AndroMDA. AndroMDA was absolutely key in helping me getting started with Spring and Hibernate and I was especially inspired by one paragraph in their “getting started” tutorial, which I quote here:
Data Propagation Between Layers
In addition to the concepts discussed previously, it is important to understand how data propagates between various layers of an application. Follow along the diagram above as we start from the bottom up.
As you know, relational databases store data as records in tables. The data access layer fetches these records from the database and transforms them into objects that represent entities in the business domain. Hence, these objects are called business entities.
Going one level up, the data access layer passes the entities to the business layer where business logic is performed.
The last thing to discuss is the propagation of data between the business layer and the presentation layer, for which there are two schools of thought. Some people recommend that the presentation layer should be given direct access to business entities. Others recommend just the opposite, i.e. business entities should be off limits to the presentation layer and that the business layer should package necessary information into so-called “value objects” and transfer these value objects to the presentation layer. Let’s look at the pros and cons of these two approaches.
The first approach (entities only, no value objects) is simpler to implement. You do not have to create value objects or write any code to transfer information between entities and value objects. In fact, this approach will probably work well for simple, small applications where the the presentation layer and the service layer run on the same machine. However, this approach does not scale well for larger and more complex applications. Here’s why:
- Business logic is no longer contained in the business layer. It is tempting to freely manipulate entities in the presentation layer and thus spread the business logic in multiple places — definitely a maintenance nightmare. In case there are multiple front-ends to a service, business logic must be duplicated in all these front-ends. In addition, there is no protection against the presentation layer corrupting the entities – intentionally or unintentionally!
- When the presentation layer is running on a different machine (as in the case of a rich client), it is very inefficient to serialize a whole network of entities and send it across the wire. Take the example of showing a list of orders to the user. In this scenario, you really don’t need to transfer the gory details of every order to the client application. All you need is perhaps the order number, order date and total amount for each order. If the user later wishes to see the details of a specific order, you can always serialize that entire order and send it across the wire.
- Passing real entities to the client may pose a security risk. Do you want the client application to have access to the salary information inside the Employee object or your profit margins inside the Order object?
Value objects provide a solution for all these problems. Yes, they require you to write a little extra code; but in return, you get a bullet-proof business layer that communicates efficiently with the presentation layer. You can think of a value object as a controlled view into one or more entities relevant to your client application. Note that AndroMDA provides some basic support for translation between entities and value objects, as you will see in the tutorial.
Because of this paragraph, I started writing all my business services with only data transfer objects (what they call “value objects”) as input and output. And it worked great. Yes it did require a little bit of coding, especially as I had not discovered Groovy yet, but it was worth the time, for all the following reasons.
The conceptual argument: presentation/storage impedance mismatch
Object-relational mapping is what Joel Spolsky calls a “Leaky Abstraction“. It’s supposed to hide away the fact that your business entities are in fact stored in a relational database, but it forces you to do all sorts of choices because of that very fact. You have to save data in a certain order in order not to break certain integrity constraints, certain patterns are to be avoided for better query performance, and so on and so forth. So whether we like it or not, our domain model is filled with “relational choices”.
Now the way data is presented involves a whole different set of constraints. Data is very often presented in a master/detail format, which means you first display a list of items, with only a few fields for each item, and possible some of those fields are calculated based on data that is stored in the database. For example, you may store a country code in your database, but you will display the full country name in the list. And then when the user double-clicks an item, he can see all the fields for that item. This pattern is totally different from how you actually store the data.
So even though some of the fields in your DTO’s will be mere copies of their counterparts in the entity, that’s only true for simple String-typed fields. As soon as you start dealing with dates, formatted floats or enum codes, there is some transformation involved, and doing all that transformation on the client-side is not always the best option, especially when you have several user interfaces on top of your backend (a Flex app and an iPhone app for example), in which case you’re better off doing most of these transformations on the server.
In anyway, if you change the way you store data, it should not influence too much the way you present the same data, and vice-versa. This decoupling is very important for me.
The bandwidth argument: load just the data you need
In the master/data use case, when you display the list of items, you just need a subset of the fields from your entities, not all of them. And even though you’re using Hibernate on the backend with lazy-loading enabled, fields are still initialized and transferred over the wire. So if you use entity classes for data transfer, you will end up transferring a whole bunch of data that may never be used. Now it might not be very important for hundreds of records, but it starts being a problem with thousands of records, especially when there is some parsing involved. The less data you transfer the better.
The security argument: show only the data you want to show
Let’s say you’re displaying a list of users, and in the database, each user has a credit card number. Now of course when you display a list of users, you might not want everyone to see the list of credit card numbers. You might want to expose this data only in detail view for certain users with certain privileges. DTO’s allow you to tailor your API to expose just the data you need.
The error-prone argument: argh! Yet another LazyInitializationException!
Of course there are associations between your business entities, and by default, those associations are lazy-loaded, which means they are not initialized until you actually query them. So if you just load a bunch of instances from your entity manager and send them over to your client, the client might end up with null collections. Now of course you can always pay attention, or use some tricks to initialize associations up to a certain level before you send your data, but this process is not automatic and it’s very error-prone. As for using things like dpHibernate, I think it just adds too much complexity and uncontrolled server requests.
The laziness argument: Come on! It’s not that hard!
I think that most of the time, the real reason why people don’t want to use DTO’s is because they’re lazy. Creating new classes, maintaining code that does “almost” the same as existing code, adding some code to service implementation to copy data back and forth, all of that takes time and effort. But laziness has never been a good reason for ditching a design pattern altogether. Yes, sometimes, best practices force us to do more stuff for the sake of maintainability and robustness of our code, and for me the solution is certainly not to shortcut the whole practice, but just to find the best tools to minimize the added work. With its property support and collection closures, Groovy makes both creating, maintaining and feeding DTO’s as simple and fast as it can be. AndroMDA had converters. There are even some DTO-mapping frameworks like Dozer to help you. No excuse for laziness.
For me, all the reasons above largely overcome the added work to maintain a parallel DTO structure.
Now of course, this is a very opinionated topic and you will probably have a different view. So all your comments are welcome as long as they remain constructive and argumented.
JVM Web Framework Survey, First Results
Yesterday at Devoxx, Matt Raible did a very interesting talk on comparing JVM web frameworks. On this occasion he had the incredible courage of voicing his opinion on each of the most well-known frameworks, rating them in a matrix and the craziest part: showing this matrix to everyone.
Immediately after his talk, Twitter was on fire with advocates of each of those frameworks complaining about how those ratings were unfair and biased. I mean of course, I can hardly talk about 3 or 4 of these frameworks with the same level of confidence, but the guy has enough experience to have played with at least 13 of them, and it’s perfectly normal to expect him to have up-to-date and accurate feedback about all of them.
Anyway, his talk was highly entertaining but in the end it inspired me 2 reflections:
- His list of 20 criteria is excellent and covers pretty much everything, except maybe for “graphics design integration” which I think is very important and some frameworks make it much easier than other, like Flex with Flash Catalyst for example. So even if you don’t agree with the ratings, you can still reuse his methodology, build 13 proof of concepts and rate them yourself.
- Rather than complaining, let’s do a survey.
So right after the talk, I built a small Google docs survey, and to this date I got 26 answers, which I think is far less than the number of complaints, but is already a good start. Here are the first results based on those 26 responses. As you can see, there was a small issue with Google Docs who didn’t correctly save the results for the last criterion, degree of risk. So the rankings are based on only 19 criteria so far. But if you still want to voice your opinion, you can still do it. I will update the results from time to time and this time, the 20th criterion should be considered.
Thanks again Matt Raible for this very inspiring talk, and thanks to all the Devoxx team for yet another memorable edition.
By the way, as far as I’m concerned, I’m pretty happy with Grails and Flex at the moment, but after the amazing demos I saw at Devoxx, I will probably have a deeper look at Vaadin very soon. And please Jetbrains, we need more visual designers (Flex? Vaadin?).
Looking for Colleagues
As a freelance software developer, I’m currently working for a small but excellent company called Vivansa. We develop products and offer consulting services for the eCustoms sector, working closely with the European Commission and with national customs administrations as well as economic operators. And from a technological standpoint, we’re doing everything the SOA way. But not the buzzword type of SOA! The real working, clever and robust kind of SOA. We have some very talented people, very open-minded, modern, pragmatic and passionate people, but we want more. We want to keep helping customs get more efficient in implementing their ambitious paperless single-screen transition and we need new collaborators to help us do that. At the moment, we’re looking for Business Process Designers, Java developers, Security experts, but more importantly we’re looking for passionate and curious people like us. So if you’re looking for a good opportunity to change job and benefit from all the dynamism and opportunities of a fast-growing company with a good spirit, come and join us. Have a look at job offers on our site (I know, it’s not very sexy, but does that really matter to you?) and contact me to know more or apply online.
It’s not my habit to do that sort of things on my blog and I have absolutely no interest in doing it, but I’m glad I found this company as a customer, and we have some good stuff coming and I just want to share it with fellow passionate developers because I know so many people are just bored in their current job. Well if you don’t want to be bored anymore, come and see for yourself, that’s all I can say.
Here Comes Grails APNs Plugin
That’s it. I’ve released my first Grails plugin ever. Woooo! Champagne!
If you follow my Twitter feed, you’ve probably noticed that I’ve been playing a lot with Apple Push Notification service lately (APNs for friends). Indeed, ConferenceGuide still requires a data connection, which can be problematic on a lot of events because they’re usually abroad (and roaming fees are waaaaaay too expensive), and even when you do have a data connection, it’s usually pretty slow… at best. That’s probably why one of the most requested features for ConferenceGuide is Offline Mode.
But getting all the data directly from the server does have at least one advantage: you’re always up-to-date. And experience has shown that sh** happens: sometimes sessions are cancelled at the last minute, or a global sound mixer reboots out of nowhere, thus shifting all sessions by 15 minutes. Those of you who were at Devoxx last November know what I’m talking about. So I needed a way to combine the best of both worlds: being able to browse schedule and speaker information without a data connection, and still get updates whenever something changes and I can find a wifi hotspot or something.
The first part of the solution is the local database. The second part involves sending push notifications. The problem with the latter is that the API provided by Apple is pretty low-level and the documentation is rather scarce. And it’s understandable because they expose a service that should be usable by any server technology, whether it is Java, .Net, PHP, Rails, etc. Fortunately, Java has a huge community and a great Open Source spirit, so it wasn’t long before a few projects were created to build an abstraction layer on top of APNs API. The simplest and most documented one I found is java-apns by Mahmood Ali. But ConferenceGuide server is not plain Java. It’s Grails 1.1 (I haven’t taken the risk to migrate to 1.2 yet). So I wanted to ease the integration of java-apns into any Grails application. And voilà! Grails APNs Plugin.
Special thanks to Burt Beckwith for helping me get started, and Mahmood Ali for developing java-apns!








