Showing posts sorted by relevance for query object oriented. Sort by date Show all posts
Showing posts sorted by relevance for query object oriented. Sort by date Show all posts

Wednesday, October 5, 2022

PHP: Object-Oriented Programming with Databases

 Learn how to interact with databases using object-oriented PHP code. In this intermediate course, Kevin Skoglund teaches powerful PHP techniques that streamline interactions with MySQL databases. PHP developers will benefit from the efficient, well-organized, reusable, and easy-to-understand code that object-oriented programming (OOP) offers. Kevin shows how OOP techniques can optimize database queries, help manage sessions, and simplify user logins. He provides practical examples and tips to create objects that interact seamlessly with database rows, to build a content management system with HTML forms, to authenticate users, and to break up long lists of database data into smaller pages.


Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.

Learning objectives

  • Creating a project database and tables
  • Connecting to the database
  • Database queries with OOP
  • The active record design pattern
  • Defining a database-driven class
  • Performing common database tasks with OOP
  • Creating inheritable and reusable code
  • Object-oriented user authentication
  • Object-oriented pagination

Thursday, July 28, 2022

Linkedin post: Dinesh Varyani

 


Feed detail update

Feed post

Recently I have received a lot of queries regarding my preparation that landed me in FAANG company. Below are some of the resources that helped me a lot -

✅ 𝐂𝐨𝐝𝐢𝐧𝐠 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Solve Leetcode medium-level problems (at least more than 250+ covering different topics)
👉 I have created an xlsx on top/important 500 leetcode questions (https://lnkd.in/dWn73jXd) and a video on How to Crack The Coding Interview? (https://lnkd.in/dsn4cipq). 
👉 Clement Mihailescu's AlgoExpert 160 handpicked questions (In case you want to prepare fast and only good questions)
👉 I watched my DSA playlist to revise concepts at 2x speed. (https://lnkd.in/dJfS9FkD)

✅ 𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 / 𝐇𝐢𝐠𝐡-𝐋𝐞𝐯𝐞𝐥 𝐃𝐞𝐬𝐢𝐠𝐧 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Grokking the System Design Interview - It has step-by-step discussion and good case studies (https://lnkd.in/dbv8GhK7)
👉 Alex Xu's System Design Interview course on ByteByteGo (https://bytebytego.com/) - The course covers all the content from his famous book (Vol 1 and Vol 2) System Design Interview
👉 Clement Mihailescu #SystemsExpert (https://lnkd.in/d-5mSpfw) videos to know how real-life System Design Interviews go 

✅ 𝐎𝐛𝐣𝐞𝐜𝐭 𝐎𝐫𝐢𝐞𝐧𝐭𝐞𝐝 𝐃𝐞𝐬𝐢𝐠𝐧 / 𝐋𝐨𝐰-𝐋𝐞𝐯𝐞𝐥 𝐃𝐞𝐬𝐢𝐠𝐧 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Grokking the Object Oriented Design Interview (https://lnkd.in/dcwE3v6V) - A very detailed and step-by-step approach to various object-oriented design case studies. 

✅ 𝐀𝐏𝐈 𝐃𝐞𝐬𝐢𝐠𝐧 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Best Practices (https://lnkd.in/d_x39xkK), Implementation (https://lnkd.in/d5fhXZJ7), and Guidelines (https://lnkd.in/dr397Hy2) of API Design
👉 Look for use cases like - Stripe (https://lnkd.in/dsM7PpJt) and Twitter (https://lnkd.in/dxiMu8wr) API Documentation
👉 #SystemsExpert also has a few case studies on API design as well

✅ 𝐒𝐜𝐡𝐞𝐦𝐚 / 𝐃𝐚𝐭𝐚𝐛𝐚𝐬𝐞 𝐃𝐞𝐬𝐢𝐠𝐧 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Grokking the Object Oriented Design Interview (https://lnkd.in/dcwE3v6V) - Take the case studies and try to apply Object to Relational Mapping strategy

✅ 𝐁𝐞𝐡𝐚𝐯𝐢𝐨𝐫𝐚𝐥 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰
👉 Watch Jeff H Sipe, Interview / Negotiation Coach Youtube channel for behavioral questions (https://lnkd.in/d6rgxbnr)
👉 https://lnkd.in/dXBfNNK9

✅ 𝐈𝐦𝐩𝐨𝐫𝐭𝐚𝐧𝐭 𝐃𝐒𝐀 𝐭𝐨𝐩𝐢𝐜𝐬?
Array, Binary Search, Sliding Window, Matrix, Two Pointer, Intervals, Hash Map, String, Recursion, DP, Trees, Graph, Linked List, Stack, Queue & Heap

If you're interested in interview preparation tips and DSA, make sure to -
✅ Subscribe to my Youtube channel - https://lnkd.in/e-49_sP
✅ Please follow me on Linkedin - Dinesh Varyani 

#interview #design #coding #faang #bytebytego #systemdesign #codinginterview #oop #algorithm #datastructures #datastructuresandalgorithms #learning

Tuesday, February 20, 2024

A tour of the C# language

Here is the article.

In this article

  1. .NET architecture
  2. Hello world
  3. Types and variables
  4. Program structure

C# (pronounced "See Sharp") is a modern, object-oriented, and type-safe programming language. C# enables developers to build many types of secure and robust applications that run in .NET. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers. This tour provides an overview of the major components of the language in C# 11 and earlier. If you want to explore the language through interactive examples, try the introduction to C# tutorials.

C# is an object-oriented, component-oriented programming language. C# provides language constructs to directly support these concepts, making C# a natural language in which to create and use software components. Since its origin, C# has added features to support new workloads and emerging software design practices. At its core, C# is an object-oriented language. You define types and their behavior.

Several C# features help create robust and durable applications. Garbage collection automatically reclaims memory occupied by unreachable unused objects. Nullable types guard against variables that don't refer to allocated objects. Exception handling provides a structured and extensible approach to error detection and recovery. Lambda expressions support functional programming techniques. Language Integrated Query (LINQ) syntax creates a common pattern for working with data from any source. Language support for asynchronous operations provides syntax for building distributed systems. C# has a unified type system. All C# types, including primitive types such as int and double, inherit from a single root object type. All types share a set of common operations. Values of any type can be stored, transported, and operated upon in a consistent manner. Furthermore, C# supports both user-defined reference types and value types. C# allows dynamic allocation of objects and in-line storage of lightweight structures. C# supports generic methods and types, which provide increased type safety and performance. C# provides iterators, which enable implementers of collection classes to define custom behaviors for client code.

C# emphasizes versioning to ensure programs and libraries can evolve over time in a compatible manner. Aspects of C#'s design that were directly influenced by versioning considerations include the separate virtual and override modifiers, the rules for method overload resolution, and support for explicit interface member declarations.

.NET architecture

C# programs run on .NET, a virtual execution system called the common language runtime (CLR) and a set of class libraries. The CLR is the implementation by Microsoft of the common language infrastructure (CLI), an international standard. The CLI is the basis for creating execution and development environments in which languages and libraries work together seamlessly.

Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code and resources, such as bitmaps and strings, are stored in an assembly, typically with an extension of .dll. An assembly contains a manifest that provides information about the assembly's types, version, and culture.

When the C# program is executed, the assembly is loaded into the CLR. The CLR performs Just-In-Time (JIT) compilation to convert the IL code to native machine instructions. The CLR provides other services related to automatic garbage collection, exception handling, and resource management. Code that's executed by the CLR is sometimes referred to as "managed code." "Unmanaged code," is compiled into native machine language that targets a specific platform.

Language interoperability is a key feature of .NET. IL code produced by the C# compiler conforms to the Common Type Specification (CTS). IL code generated from C# can interact with code that was generated from the .NET versions of F#, Visual Basic, C++. There are more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages. The types can reference each other as if they were written in the same language.

In addition to the runtime services, .NET also includes extensive libraries. These libraries support many different workloads. They're organized into namespaces that provide a wide variety of useful functionality. The libraries include everything from file input and output to string manipulation to XML parsing, to web application frameworks to Windows Forms controls. The typical C# application uses the .NET class library extensively to handle common "plumbing" chores.



Monday, April 5, 2021

Domain-driven design | Book reading: Design domain-driven design Eric Evens

 April 5, 2021

Domain-driven design (DDD) is the concept that the structure and language of software code (class names, class methods, class variables) should match the business domain. For example, if a software processes loan applications, it might have classes such as LoanApplication and Customer, and methods such as AcceptOffer and Withdraw.

DDD connects the implementation to an evolving model.[1]

Domain-driven design is predicated on the following goals:

  • placing the project's primary focus on the core domain and domain logic;
  • basing complex designs on a model of the domain;
  • initiating a creative collaboration between technical and domain experts to iteratively refine a conceptual model that addresses particular domain problems.

The term was coined by Eric Evans in his book of the same title.


Relationship to other ideas[edit]

Object-oriented analysis and design
Although, in theory, the general idea of DDD need not be restricted to object-oriented approaches, in practice, DDD seeks to exploit the advantages that object-oriented techniques make possible. These include entities/aggregate roots as receivers of commands/method invocations and the encapsulation of state within foremost aggregate roots and on a higher architectural level, bounded contexts.
Model-driven engineering (MDE) and Model-driven architecture (MDA)
While DDD is compatible with MDA/MDE (where MDE can be regarded as a superset of MDA) the intent of the two concepts is somewhat different. MDA is concerned more with the means of translating a model into code for different technology platforms than with the practice of defining better domain models. The techniques provided by MDE (to model domains, to create DSLs to facilitate the communication between domain experts and developers,...) facilitate the application of DDD in practice and help DDD practitioners to get more out of their models. Thanks to the model transformation and code generation techniques of MDE, the domain model can be used not only to represent the domain but also to generate the actual software system that will be used to manage it. This picture shows a possible representation of DDD and MDE combined.
Plain Old Java Objects (POJOs) and Plain Old CLR Objects (POCOs)
POJOs and POCOs are technical implementation concepts, specific to Java and the .NET Framework respectively. However, the emergence of the terms POJO and POCO reflect a growing view that, within the context of either of those technical platforms, domain objects should be defined purely to implement the business behaviour of the corresponding domain concept, rather than be defined by the requirements of a more specific technology framework.
The naked objects pattern
Based on the premise that if you have a good enough domain model, the user interface can simply be a reflection of this domain model; and that if you require the user interface to be a direct reflection of the domain model, then this will force the design of a better domain model.[4]
Domain-specific modeling (DSM)
DSM is DDD applied through the use of Domain-specific languages.
Domain-specific language (DSL)
DDD does not specifically require the use of a DSL, though it could be used to help define a DSL and support methods like domain-specific multimodeling.
Aspect-oriented programming (AOP)
AOP makes it easy to factor out technical concerns (such as security, transaction management, logging) from a domain model, and as such makes it easier to design and implement domain models that focus purely on the business logic.
Command Query Responsibility Segregation (CQRS)
CQRS is an architectural pattern for separation of reads from writes, where the former is a Query and the latter is a Command. Commands mutate state and are hence approximately equivalent to method invocation on aggregate roots/entities. Queries read state but do not mutate it. CQRS is a derivative architectural pattern from the design pattern called Command and Query Separation (CQS) which was coined by Bertrand Meyer. While CQRS does not require DDD, domain-driven design makes the distinction between commands and queries explicit, around the concept of an aggregate root. The idea is that a given aggregate root has a method that corresponds to a command and a command handler invokes the method on the aggregate root. The aggregate root is responsible for performing the logic of the operation and yielding either a number of events or a failure (exception or execution result enumeration/number) response OR (if Event Sourcing (ES) is not used) just mutating its state for a persister implementation such as an ORM to write to a data store, while the command handler is responsible for pulling in infrastructure concerns related to the saving of the aggregate root's state or events and creating the needed contexts (e.g., transactions).
Event Sourcing (ES)
An architectural pattern which warrants that your entities (as per Eric Evans' definition) do not track their internal state by means of direct serialization or O/R mapping, but by means of reading and committing events to an event store. Where ES is combined with CQRS and DDD, aggregate roots are responsible for thoroughly validating and applying commands (often by means of having their instance methods invoked from a Command Handler), and then publishing a single or a set of events which is also the foundation upon which the aggregate roots base their logic for dealing with method invocations. Hence, the input is a command and the output is one or many events which are transactionally (single commit) saved to an event store, and then often published on a message broker for the benefit of those interested (often the views are interested; they are then queried using Query-messages). When modeling your aggregate roots to output events, you can isolate the internal state even further than would be possible when projecting read-data from your entities, as is done in standard n-tier data-passing architectures. One significant benefit from this is that tooling such as axiomatic theorem provers (e.g., Microsoft Contracts and CHESS[5]) are easier to apply, as the aggregate root comprehensively hides its internal state. Events are often persisted based on the version of the aggregate root instance, which yields a domain model that synchronizes in distributed systems around the concept of optimistic concurrency.