O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

20190627 j hipster-conf- diary of a java dev lost in the .net world

113 visualizações

Publicada em

Let's discover the "fresh-eye" report of a Java dev discovering the .Net world.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

20190627 j hipster-conf- diary of a java dev lost in the .net world

  1. 1. Diary of a Java dev lost in the .Net world JHipsterConf, 27/06/2019 1
  2. 2. Who are you? ● .Net (core) ○ C#? ● Java ○ Java? ○ Kotlin? ○ Groovy? ○ Scala? ○ Golo?? ● JHipster? ● Vert.x? 2
  3. 3. @gaultierlarge + @FlorianGourdeau 3
  4. 4. @danielpetisme @lavajug @golo_lang @vertx_project @java_hipster @Michelin 4
  5. 5. JVM 5
  6. 6. 6
  7. 7. 7
  8. 8. Day#1: The definitions 8
  9. 9. What the hell is .Net? 9
  10. 10. .Net Framework vs .Net Core vs .Net Standard 10
  11. 11. Day#2: The language 11
  12. 12. 13
  13. 13. My Top3
  14. 14. Data Objects var userDto = new UserDto { Login = "not-used", FirstName = "firstname", LastName = "lastname", Email = "save-existing-email-and-login@example.com", Activated = false, ImageUrl = "http://placehold.it/50x50", LangKey = Constants.DefaultLangKey, Roles = new HashSet<string> { RolesConstants.USER } }; https://try.dot.net/?fromGist=c9fa9087655d352b5a4d594bb228e948 15
  15. 15. Async native (1/2) public async Task<User> CreateUser(UserDto userDto) { var user = new User { UserName = userDto.Login.ToLower(), FirstName = userDto.FirstName, LastName = userDto.LastName, Email = userDto.Email.ToLower(), ImageUrl = userDto.ImageUrl, LangKey = userDto.LangKey ?? Constants.DefaultLangKey, PasswordHash = "..." ResetKey = RandomUtil.GenerateResetKey(), ResetDate = DateTime.Now, Activated = true }; await _userManager.CreateAsync(user); await CreateUserRoles(user, userDto.Roles); _log.LogDebug( $"Created Information for User: {user}"); return user; } https://try.dot.net/?fromGist=c9fa9087655d352b5a4d594bb228e948 16
  16. 16. Reactive eXtensions 17
  17. 17. Extensions (1/3) https://try.dot.net/?fromGist=aa789fa70bcd0e5db2aac00018be0c5f public static class StringExtension { public static string Capitalize(this string str) { return char.ToUpper(str[0]) + str.Substring(1); } public static string Decorate(this string str, string decoration) => $"{decoration} {str} {decoration}"; } public class Program { public static void Main() { Console.WriteLine("java".Capitalize()); Console.WriteLine("Java + C#".Decorate("🧡")); } } 18
  18. 18. Extensions (2/3) public static class WebConfiguration { public static IServiceCollection AddWebModule( this IServiceCollection @this) { @this.AddHttpContextAccessor(); //https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-2.2 @this.AddHealthChecks(); @this.AddMvc(options => { options. ModelBinderProviders.Insert(0, new PageableBinderProvider()); }) .SetCompatibilityVersion(CompatibilityVersion. Version_2_2) .AddJsonOptions(options => { options. SerializerSettings.NullValueHandling = NullValueHandling. Ignore; }); return @this; } } 19
  19. 19. Extensions (3/3) public void ConfigureServices(IServiceCollection services) { services .AddDatabaseModule( Configuration) .AddSecurityModule() .AddProblemDetailsModule() .AddAutoMapperModule() .AddWebModule() .AddSwaggerModule(); } 20
  20. 20. Type inference 2007 2018 Data objects 2007 N/A Extensions 2007 N/A Traits 2018 2014 String Interpolation 2015 N/A C# > Java ?
  21. 21. JVM rulezz
  22. 22. CLR ???
  23. 23. https://www.jetbrains.com/rider/ 24
  24. 24. Day#3 Frameworks 25
  25. 25. 26
  26. 26. 27
  27. 27. “Just enough to not start from scratch, not enough to be enterprise-friendly” 28
  28. 28. Issues Action/Headers weird with HTTP APIs Pagination DbConcurrencyException (catch’em all) Manual DI Configure file Management Audit Testing fixtures 30
  29. 29. Day#4: The ecosystem 31
  30. 30. 32
  31. 31. https://octoverse.github.com/projects#repositories 33
  32. 32. .Net Developper in 2019 34
  33. 33. 4years... Fancy a PR? https://github.com/aspnet/EntityFrameworkCore/issues/1368#issuecomment-473521834 35
  34. 34. Java, open by nature 36
  35. 35. Java-ish foundations 37
  36. 36. .Net Foundation �� 38
  37. 37. Day#5: JHipster.Net 39
  38. 38. 40
  39. 39. Objectives ● Enhance (Asp.Net|Entity Framework) Core ○ Pagination ○ Security|identity ○ Audit trail ● Focus on Developer eXperience ○ Opinionated standards based on community proposals ○ CRUD generation ○ Binary packaging ○ Environment management ○ Docker ● Reuse frontend generation ○ Angular|React|Vue.js 41
  40. 40. 42
  41. 41. 43
  42. 42. 44
  43. 43. CGI (Grenoble) and open source 45
  44. 44. CGI (Grenoble) and Jhipster 46
  45. 45. EF Core vs Hibernate ● Eager loading ● Many to many 47
  46. 46. Demo ! 48
  47. 47. What’s next? ● Client ○ React/Vue.js ● Entity Server ○ Testing Generation ● Entity Client ○ Code Generation ○ Testing Generation ● Global ○ Blueprint test ○ DX (docker, quality, etc.)
  48. 48. Join us to develop Jhispter .Net https://github.com/jhipster/jhipster-dotnetcore https://github.com/jhipster/jhipster-net-sample-app-template 50
  49. 49. Q&A 51

×