Thread: Java Lazy initialization

Results 1 to 5 of 5
  1. #1 Java Lazy initialization 
    Registered Member
    Join Date
    Dec 2010
    Age
    25
    Posts
    139
    Thanks given
    8
    Thanks received
    7
    Rep Power
    13
    Hey guys, Do you happen to know if there's a library that doesnt bloat too much my codebase and provides lazy initialization? (For non singletons)
    This is a feature in other programming languages such as c#
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jul 2008
    Posts
    76
    Thanks given
    3
    Thanks received
    5
    Rep Power
    3
    Hi

    Maybe this doc can push you into the right direction.
    https://docs.oracle.com/en/java/java...assLoader.html

    You could implement your own class loader into your app
    You'd have to be more specific if you want more help though...
    Reply With Quote  
     

  3. #3  
    Blurite

    Corey's Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,491
    Thanks given
    1,245
    Thanks received
    1,729
    Rep Power
    5000
    Doesn't exactly answer your question, however Kotlin has this feature: https://kotlinlang.org/docs/referenc...ties.html#lazy
    Kotlin in general has more features than Java, including other features from C# such as extension methods.
    Attached image
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Extreme Donator

    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    104
    Thanks given
    99
    Thanks received
    107
    Rep Power
    810
    Quote Originally Posted by Strucker View Post
    Hey guys, Do you happen to know if there's a library that doesnt bloat too much my codebase and provides lazy initialization? (For non singletons)
    This is a feature in other programming languages such as c#
    Use a DI container then you can get your container to manage the scope of the service .e.g. Singleton
    Reply With Quote  
     

  6. #5  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,253
    Thanks given
    1,145
    Thanks received
    909
    Rep Power
    2081
    Quote Originally Posted by Corey View Post
    Kotlin in general has more features than Java, including other features from C# such as extension methods.
    Java is slow as fuck to adopt new tech though. Still waiting for properties since about ten years ago.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Java Version Fix
    By Dino1001Rules in forum Tools
    Replies: 10
    Last Post: 08-30-2012, 10:44 PM
  2. Use Lazy Initialization in singleton pattern
    By Ed in forum Application Development
    Replies: 14
    Last Post: 04-30-2010, 12:42 PM
  3. Replies: 5
    Last Post: 06-16-2007, 08:57 PM
  4. [Huge-Tut]MagicHandler.java [Basically full magic]..
    By Santa Clause in forum Tutorials
    Replies: 55
    Last Post: 05-16-2007, 11:55 AM
  5. New Version of my old ¨Java Coder Sig¨
    By Ndugu in forum Showcase
    Replies: 2
    Last Post: 04-26-2007, 08:59 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •