Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Diary of a Java dev lost in the .Net world - LyonJug + LyonMug

37 vues

Publié le

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

Publié dans : Technologie
  • Soyez le premier à commenter

Diary of a Java dev lost in the .Net world - LyonJug + LyonMug

  1. 1. Diary of a Java dev lost in the .Net world LyonJug, 12/06/2019
  2. 2. Who are you? ● .Net (core) ○ C#? ● Java ○ Java? ○ Kotlin? ○ Groovy? ○ Scala? ○ Golo?? ● JHipster? ● Vert.x?
  3. 3. @danielpetisme @lavajug @golo_lang @vertx_project @java_hipster @Michelin
  4. 4. JVM
  5. 5. Day#1: The definitions
  6. 6. What the hell is .Net?
  7. 7. .Net Framework vs .Net Core vs .Net Standard
  8. 8. Day#2: The language
  9. 9. My Top3
  10. 10. https://try.dot.net
  11. 11. 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
  12. 12. 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
  13. 13. Reactive eXtensions
  14. 14. 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("🧡")); } }
  15. 15. 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; } }
  16. 16. Extensions (3/3) public void ConfigureServices(IServiceCollection services) { services .AddDatabaseModule( Configuration) .AddSecurityModule() .AddProblemDetailsModule() .AddAutoMapperModule() .AddWebModule() .AddSwaggerModule(); }
  17. 17. Type inference 2007 2018 Data objects 2007 N/A Extensions 2007 N/A Traits 2018 2014 String Interpolation 2015 N/A C# > Java ?
  18. 18. JVM rulezz
  19. 19. CLR ???
  20. 20. https://www.jetbrains.com/rider/
  21. 21. Day#3 Frameworks
  22. 22. “Just enough to not start from scratch, not enough to be enterprise-friendly”
  23. 23. Issues Action/Headers weird with HTTP APIs Pagination DbConcurrencyException (catch’em all) Manual DI Configure file Management Audit Testing fixtures
  24. 24. Day#4: The ecosystem
  25. 25. https://octoverse.github.com/projects#repositories
  26. 26. .Net Developper in 2019
  27. 27. 4years... Fancy a PR? https://github.com/aspnet/EntityFrameworkCore/issues/1368#issuecomment-473521834
  28. 28. 1999: Java Community Proccess
  29. 29. Java-ish foundations
  30. 30. .Net Foundation ��
  31. 31. Day#5: JHipster.Net
  32. 32. Generator != Framework
  33. 33. +
  34. 34. 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
  35. 35. Thank you @kbeaugrand @authfix @LGouellec @GaultierLarge @FlorianGourdeau
  36. 36. Take Away
  37. 37. Q&A

×