Posts

How the transient Keyword Impacts Java Serialization

Image
  The  transient   keyword in Java is used to mark fields in a class that should not be serialized. Serialization is the process of converting an object into a byte stream, so it can be saved to a file, sent over a network, etc. When an object is serialized, all of its fields are usually saved. However, fields marked with   transient  are ignored during this process. Why Use the transient Keyword? There are several reasons why you might want to exclude certain fields from being serialized: Temporary or Computed Values : Some fields are temporary or calculated on the fly. These fields don’t need to be persisted or restored when deserializing the object. Sensitive Information : Fields like passwords, API keys, or security tokens contain sensitive data that should not be saved or shared. Non-Serializable Fields : Some objects, such as file streams, database connections, or thread objects, cannot be serialized. By marking these fields as  transient , you avoid ...

Object-Oriented Analysis and Design: An Introduction to UML Diagrams

Image
  Object-Oriented Analysis and Design (OOAD) is a structured approach to designing software systems by modeling real-world entities as objects. This methodology emphasizes breaking down complex systems into manageable, interacting components, making them easier to understand, develop, and maintain. Unified Modeling Language (UML) diagrams play a crucial role in visualizing and documenting these designs. Here, we’ll explore essential UML diagrams used in OOAD and highlight the focus areas for interviews. What is Object-Oriented Analysis and Design? Object-Oriented Analysis and Design (OOAD) involves: Identifying Objects : Determine the entities in the system (e.g., Customer, Order, Product). Defining Relationships : Understand how these objects interact with each other (e.g., Customer places an Order). Establishing Interfaces : Specify how objects will interact through methods and attributes. Designing the System : Create a design that can be implemented using an object-oriented pro...

Understanding Object-Oriented Basics for Low-Level Design

  Object-Oriented Programming (OOP) is one of the most important concepts in software development, especially when designing scalable, maintainable systems. This guide will break down the fundamentals of OOP, using simple language and relatable examples, and explain how they can be applied to low-level design (LLD). What is Object-Oriented Programming? In OOP, we model real-world entities as  objects  in software. These objects have two key characteristics: Attributes : What an object has (properties or data). Behaviors : What an object does (functions or methods). For example, let’s imagine a  Car  object. A car has attributes like  color ,  brand , and  speed . It also has behaviors like  start() ,  accelerate() , and  brake() . Key Principles of Object-Oriented Programming There are four fundamental principles of OOP: Encapsulation Abstraction Inheritance Polymorphism 1. Encapsulation Encapsulation means  bundling the data (...