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.

Diary of a Java dev lost in the .Net world - MugInClermont

36 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

Diary of a Java dev lost in the .Net world - MugInClermont

  1. 1. Diary of a Java dev lost in the .Net world MugInClermont, 21/02/2019
  2. 2. @danielpetisme @lavajug @golo_lang @vertx_project @java_hipster @Michelin
  3. 3. JVM
  4. 4. Day#1: The language
  5. 5. My Top3
  6. 6. 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 } };
  7. 7. 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; }
  8. 8. Reactive eXtensions
  9. 9. Extensions (1/2) 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; } }
  10. 10. Extensions (2/2) public void ConfigureServices(IServiceCollection services) { services .AddDatabaseModule( Configuration) .AddSecurityModule() .AddProblemDetailsModule() .AddAutoMapperModule() .AddWebModule() .AddSwaggerModule(); }
  11. 11. Type inference 2007 2018 Data objects 2007 N/A Extensions 2007 N/A Traits 2018 2014 String Interpolation 2015 N/A C# > Java ?
  12. 12. JVM rulezz
  13. 13. CLR ???
  14. 14. https://www.jetbrains.com/rider/
  15. 15. Day#2 Frameworks
  16. 16. “Just enough to not start from scratch, not enough to be enterprise-friendly”
  17. 17. Issues Action/Headers weird with HTTP APIs Pagination DbConcurrencyException (catch’em all) Manual DI Configure file Management Audit Testing fixtures
  18. 18. Day#3: The ecosystem
  19. 19. * *: No culture of community
  20. 20. 4years... Fancy a PR?
  21. 21. https://www.nuget.org/stats/packages
  22. 22. Java-ish foundations
  23. 23. .Net attempts??
  24. 24. Day#4: JHipster.Net
  25. 25. Generator != Framework
  26. 26. +
  27. 27. 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
  28. 28. Thank you Kevin Beaugrand, Thomas Bailly, Pierre Plagnes, Sylvain Le Gouellec
  29. 29. Take Away
  30. 30. Q&A

×